Phalcon forms
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¶
/**
* @var array
*/
protected $attributes;
/**
* @var array
*/
protected $filters;
/**
* @var Form|null
*/
protected $form;
/**
* @var string|null
*/
protected $label;
/**
* @var string
*/
protected $method = inputText;
/**
* @var Messages
*/
protected $messages;
/**
* @var string
*/
protected $name;
/**
* @var array
*/
protected $options;
/**
* @var TagFactory|null
*/
protected $tagFactory;
/**
* @var array
*/
protected $validators;
/**
* @var mixed|null
*/
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 tagFactory; throws exception if not present 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 Renders the element widget returning HTML 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 the TagFactory Sets an option for the element Sets options for the element Returns the tagFactory; throws exception if not presentForms\Element\Check¶
-
Namespace
Phalcon\Forms\Element
-
Uses
-
Extends
AbstractElement
-
Implements
Component INPUT[type=check] for forms
Properties¶
Forms\Element\Date¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=date] for forms
Properties¶
Forms\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 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
Properties¶
Forms\Element\File¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=file] for forms
Properties¶
Forms\Element\Hidden¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=hidden] for forms
Properties¶
Forms\Element\Numeric¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=number] for forms
Properties¶
Forms\Element\Password¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=password] for forms
Properties¶
Forms\Element\Radio¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=radio] for forms
Properties¶
Forms\Element\Select¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag\Select
-
Extends
AbstractElement
-
Implements
Component SELECT (choice) for forms
Properties¶
Methods¶
Constructor Adds an option to the current options Returns the choices' options Renders the element widget returning HTML Set the choice's options Returns an array of prepared attributes for Phalcon\Html\TagFactory helpers according to the element parametersForms\Element\Submit¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component INPUT[type=submit] for forms
Properties¶
Forms\Element\Text¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Forms\Exception
-
Extends
AbstractElement
-
Implements
Component INPUT[type=text] for forms
Forms\Element\TextArea¶
-
Namespace
Phalcon\Forms\Element
-
Uses
Phalcon\Tag
-
Extends
AbstractElement
-
Implements
Component TEXTAREA for forms
Properties¶
Forms\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 AttributesInterface|null
*/
protected $attributes;
/**
* @var array
*/
protected $data;
/**
* @var array
*/
protected $filteredData;
/**
* @var array
*/
protected $elements;
/**
* @var array
*/
protected $elementsIndexed;
/**
* @var object|null
*/
protected $entity;
/**
* @var Messages|array|null
*/
protected $messages;
/**
* @var int
*/
protected $position = ;
/**
* @var array
*/
protected $options;
/**
* @var TagFactory|null
*/
protected $tagFactory;
/**
* @var ValidationInterface|null
*/
protected $validation;
/**
* @var array
*/
protected $whitelist;
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 Gets a value from the internal filtered data or calls getValue(name) 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