Skip to content
This repository has been archived by the owner on May 24, 2018. It is now read-only.

Latest commit

 

History

History
36 lines (25 loc) · 861 Bytes

zend.form.view.helper.form-select.rst

File metadata and controls

36 lines (25 loc) · 861 Bytes
orphan

FormSelect

The FormSelect view helper can be used to render a group <input type="select"> HTML form input. It is meant to work with the Zend\\Form\\Element\\Select <zend.form.element.select> element, which provides a default input specification for validating a select.

FormSelect extends from Zend\\Form\\View\\Helper\\FormInput <zend.form.view.helper.form-input.methods>.

Basic usage:

use Zend\Form\Element;

$element = new Element\Select('language');
$element->setValueOptions(array(
   '0' => 'French',
   '1' => 'English',
   '2' => 'Japanese',
   '3' => 'Chinese'
));

// Within your view...

/**
 * Example
 */
echo $this->formSelect($element);