On this page

View Helpers

FormMonth

The FormMonth view helper can be used to render an <input type="month"> HTML5 form input. It is meant to work with the Month element, which provides a default input specification for validating HTML5 date values.

FormMonth extends from FormDateTime.

Basic usage

use Laminas\Form\Element;

$element = new Element\Month('my-month');

// Within your view...

echo $this->formMonth($element);
// Result: <input type="month" name="my-month" value="">