NOTE
All classes are prefixed with Phalcon
Forms\Element\AbstractElement ¶
-
Namespace
Phalcon\Forms\Element
-
Uses
InvalidArgumentException
Phalcon\Di\Di
Phalcon\Di\DiInterface
Phalcon\Filter\Validation\ValidatorInterface
Phalcon\Forms\Exception
Phalcon\Forms\Form
Phalcon\Html\Escaper
Phalcon\Html\TagFactory
Phalcon\Messages\MessageInterface
Phalcon\Messages\Messages
-
Extends
-
Implements
ElementInterface
This is a base class for form elements
Properties¶
//
protected $attributes;
//
protected $filters;
//
protected $form;
//
protected $label;
//
protected $messages;
//
protected $name;
//
protected $options;
/**
* @var array
*/
protected $validators;
//
protected $value;
Methods¶
Constructor Magic method __toString renders the widget without attributes Adds a filter to current list of filters Adds a validator to the element Adds a group of validators Appends a message to the internal message list Clears element to its default value Returns the value of an attribute if present Returns the default attributes for the element Returns the default value assigned to the element Returns the element filters Returns the parent form to the element Returns the element label Returns the messages that belongs to the element The element needs to be attached to a form Returns the element name Returns the value of an option if present Returns the options for the element Returns the validators registered for the element Returns the element's value Checks whether there are messages attached to the element Generate the HTML to label the element Returns an array of prepared attributes for Phalcon\Tag helpers according to the element parameters Sets a default attribute for the element Sets default attributes for the element Sets a default value in case the form does not use an entity or there is no value available for the element in _POST Sets the element filters Sets the parent form to the element Sets the element label Sets the validation messages related to the element Sets the element name Sets an option for the element Sets options for the elementClass Phalcon\Forms\Element\Check
Forms\Element\Check¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
-
Implements
Component INPUT[type=check] for forms
Methods¶
Renders the element widget returning HTMLForms\Element\Date¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=date] for forms
Methods¶
Renders the element widget returning htmlForms\Element\ElementInterface ¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Filter\Validation\ValidatorInterface
Phalcon\Forms\Form
Phalcon\Messages\MessageInterface
Phalcon\Messages\Messages
-
Extends
-
Implements
Interface for Phalcon\Forms\Element classes
Methods¶
Adds a filter to current list of filters Adds a validator to the element Adds a group of validators Appends a message to the internal message list Clears every element in the form to its default value Returns the value of an attribute if present Returns the default attributes for the element Returns the default value assigned to the element Returns the element's filters Returns the parent form to the element Returns the element's label Returns the messages that belongs to the element The element needs to be attached to a form Returns the element's name Returns the value of an option if present Returns the options for the element Returns the validators registered for the element Returns the element's value Checks whether there are messages attached to the element Generate the HTML to label the element Returns an array of prepared attributes for Phalcon\Tag helpers according to the element's parameters Renders the element widget Sets a default attribute for the element Sets default attributes for the element Sets a default value in case the form does not use an entity or there is no value available for the element in _POST Sets the element's filters Sets the parent form to the element Sets the element label Sets the validation messages related to the element Sets the element's name Sets an option for the element Sets options for the elementForms\Element\Email¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=email] for forms
Methods¶
Renders the element widget returning HTMLForms\Element\File¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=file] for forms
Methods¶
Renders the element widget returning HTMLForms\Element\Hidden¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=hidden] for forms
Methods¶
Renders the element widget returning HTMLForms\Element\Numeric¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=number] for forms
Methods¶
Renders the element widget returning HTMLForms\Element\Password¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=password] for forms
Methods¶
Renders the element widget returning HTMLForms\Element\Radio¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=radio] for forms
Methods¶
Renders the element widget returning HTMLForms\Element\Select¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag\Select
-
Extends
AbstractElement
-
Implements
Component SELECT (choice) for forms
Properties¶
Methods¶
Phalcon\Forms\Element constructor Adds an option to the current options Returns the choices' options Renders the element widget returning HTML Set the choice's optionsForms\Element\Submit¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=submit] for forms
Methods¶
Renders the element widgetForms\Element\Text¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Forms\Exception
-
Extends
AbstractElement
-
Implements
Component INPUT[type=text] for forms
Methods¶
Renders the element widgetForms\Element\TextArea¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component TEXTAREA for forms
Methods¶
Renders the element widgetForms\Exception¶
-
Namespace
Phalcon\Forms
-
Uses
-
Extends
\Exception
-
Implements
Exceptions thrown in Phalcon\Forms will use this class
Forms\Form¶
-
Namespace
Phalcon\Forms
-
Uses
Countable
Iterator
Phalcon\Di\DiInterface
Phalcon\Di\Injectable
Phalcon\Filter\FilterInterface
Phalcon\Filter\Validation
Phalcon\Filter\Validation\ValidationInterface
Phalcon\Forms\Element\ElementInterface
Phalcon\Html\Attributes
Phalcon\Html\Attributes\AttributesInterface
Phalcon\Html\TagFactory
Phalcon\Messages\Messages
Phalcon\Tag
-
Extends
Injectable
-
Implements
AttributesInterface
Countable
Iterator
This component allows to build forms using an object-oriented interface
Properties¶
/**
* @var Attributes | null
*/
protected $attributes;
//
protected $data;
//
protected $elements;
//
protected $elementsIndexed;
//
protected $entity;
//
protected $messages;
//
protected $position;
//
protected $options;
//
protected $validation;
Methods¶
Phalcon\Forms\Form constructor Adds an element to the form Binds data to the entity Clears every element in the form to its default value Returns the number of elements in the form Returns the current element in the iterator Returns an element added to the form by its name Returns the form's action Get Form attributes collection Returns the form elements added to the form Returns the entity related to the model Returns a label for an element Returns the messages generated in the validation.if ($form->isValid($_POST) == false) {
$messages = $form->getMessages();
foreach ($messages as $message) {
echo $message, "<br>";
}
}
Forms\Manager¶
-
Namespace
Phalcon\Forms
-
Uses
-
Extends
-
Implements
Forms Manager