|
Size: | 10843 |
Storage flags: | no_autoload,compress/gzip (30%) |
Zend\Form\Element\Url is meant to be paired with the Zend\Form\View\Helper\FormUrl for HTML5 inputs with type url. This element adds filters and a Zend\Validator\Uri validator to it’s input filter specification for validating HTML5 URL input values on the server.
Basic Usage
This element automatically adds a "type" attribute of value "url".
1 2 3 4 5 6 7 8 | use Zend\Form\Element;
use Zend\Form\Form;
$url = new Element\Url('webpage-url');
$url->setLabel('Webpage URL');
$form = new Form('my-form');
$form->add($url);
|
Here is the same example using the array notation:
1 2 3 4 5 6 7 8 9 10 | use Zend\Form\Form;
$form = new Form('my-form');
$form->add(array(
'type' => 'Zend\Form\Element\Url',
'name' => 'webpage-url',
'options' => array(
'label' => 'Webpage URL'
)
));
|
Public Methods
The following methods are in addition to the inherited methods of Zend\Form\Element.
Returns a input filter specification, which includes a Zend\Filter\StringTrim filter, and a Zend\Validator\Uri to validate the URI string.
Return type: | array |
---|
The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.