Forms ----- Phalcon\Forms is a component aids the developer in the creation and maintenance of forms in web applications. The following example shows its basic usage: .. code-block:: php use Phalcon\Forms\Form, Phalcon\Forms\Element\Text; $form = new Form(); $form->add(new Text("name")); $form->add(new Text("telephone")); $form->add(new Select("telephoneType", array( 'H' => 'Home', 'C' => 'Cell' ))); Forms can be rendered based on the form definition: .. code-block:: html+php
render("name", array('maxlength' => 30, 'placeholder' => 'Type your name')) ?>
HTML Attributes also can be set in the element's definition: .. code-block:: php $form->add(new Text("name", array( 'maxlength' => 30, 'placeholder' => 'Type your name' )));