On this page

View Helpers

FormDate

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

FormDate extends from the FormDateTime helper.

Basic usage

use Laminas\Form\Element;

$element = new Element\Date('my-date');

// Within your view...

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