Zend Framework  1.12
Public Member Functions | Protected Member Functions | List of all members
Zend_View_Helper_FormSelect Class Reference

Public Member Functions

 formSelect ($name, $value=null, $attribs=null, $options=null, $listsep="<br />\n")
 Generates 'select' list of options.
 
- Public Member Functions inherited from Zend_View_Helper_FormElement
 getTranslator ()
 Get translator.
 
 setTranslator ($translator=null)
 Set translator.
 
- Public Member Functions inherited from Zend_View_Helper_HtmlElement
 getClosingBracket ()
 Get the tag closing bracket.
 
- Public Member Functions inherited from Zend_View_Helper_Abstract
 setView (Zend_View_Interface $view)
 Set the View object.
 
 direct ()
 Strategy pattern: currently unutilized.
 

Protected Member Functions

 _build ($value, $label, $selected, $disable, $optionClasses=array())
 Builds the actual <option> tag.
 
- Protected Member Functions inherited from Zend_View_Helper_FormElement
 _getInfo ($name, $value=null, $attribs=null, $options=null, $listsep=null)
 Converts parameter arguments to an element info array.
 
 _hidden ($name, $value=null, $attribs=null)
 Creates a hidden element.
 
- Protected Member Functions inherited from Zend_View_Helper_HtmlElement
 _isXhtml ()
 Is doctype XHTML?
 
 _isHtml5 ()
 Is doctype HTML5?
 
 _isStrictDoctype ()
 Is doctype strict?
 
 _htmlAttribs ($attribs)
 Converts an associative array to a string of tag attributes.
 
 _normalizeId ($value)
 Normalize an ID.
 

Additional Inherited Members

- Public Attributes inherited from Zend_View_Helper_HtmlElement
const EOL = "\n"
 EOL character.
 
- Protected Attributes inherited from Zend_View_Helper_FormElement
 $_translator
 

Member Function Documentation

_build (   $value,
  $label,
  $selected,
  $disable,
  $optionClasses = array() 
)
protected

Builds the actual <option> tag.

Parameters
string$valueOptions Value
string$labelOptions Label
array$selectedThe option value(s) to mark as 'selected'
array | bool$disableWhether the select is disabled, or individual options are
array$optionClassesThe classes to associate with each option value
Returns
string Option Tag XHTML
formSelect (   $name,
  $value = null,
  $attribs = null,
  $options = null,
  $listsep = "<br />\n" 
)

Generates 'select' list of options.

public

Parameters
string | array$nameIf a string, the element name. If an array, all other parameters are ignored, and the array elements are extracted in place of added parameters.
mixed$valueThe option value to mark as 'selected'; if an array, will mark all values in the array as 'selected' (used for multiple-select elements).
array | string$attribsAttributes added to the 'select' tag. the optional 'optionClasses' attribute is used to add a class to the options within the select (associative array linking the option value to the desired class)
array$optionsAn array of key-value pairs where the array key is the radio value, and the array value is the radio text.
string$listsepWhen disabled, use this list separator string between list values.
Returns
string The select tag and options XHTML.