On this page
Caution
The documentation you are viewing is for an older version of this component.
Switch to the latest (v3) version.
Elements
Text
Laminas\Form\Element\Text
represents a text form input.
It should be used with the FormText view helper.
Basic Usage
This element automatically adds a type
attribute of value text
.
use Laminas\Form\Element;
use Laminas\Form\Form;
$text = new Element\Text('my-text');
$text->setLabel('Enter your name');
$form = new Form('my-form');
$form->add($text);