View/Helper/FormSelect.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_View  
Subpackage
Helper  
Version
$Id$  

\Zend_View_Helper_FormSelect

Package: Zend_View\Helper
Helper to generate "select" list of options
Parent(s)
\Zend_View_Helper_FormElement < \Zend_View_Helper_HtmlElement < \Zend_View_Helper_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Methods

methodprotected_build(string $value, string $label, array $selected, array | bool $disable, array $optionClasses = array()) : string

Builds the actual

Parameters
NameTypeDescription
$valuestring

Options Value

$labelstring

Options Label

$selectedarray

The option value(s) to mark as 'selected'

$disablearray | bool

Whether the select is disabled, or individual options are

$optionClassesarray

The classes to associate with each option value

Returns
TypeDescription
stringOption Tag XHTML
methodpublicformSelect(string | array $name, mixed $value = null, array | string $attribs = null, array $options = null, string $listsep = "
\n")
: string

Generates 'select' list of options.

Parameters
NameTypeDescription
$namestring | array

If a string, the element name. If an array, all other parameters are ignored, and the array elements are extracted in place of added parameters.

$valuemixed

The option value to mark as 'selected'; if an array, will mark all values in the array as 'selected' (used for multiple-select elements).

$attribsarray | string

Attributes 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)

$optionsarray

An array of key-value pairs where the array key is the radio value, and the array value is the radio text.

$listsepstring

When disabled, use this list separator string between list values.

Returns
TypeDescription
stringThe select tag and options XHTML.
Details
Access
public  
Documentation was generated by phpDocumentor 2.2.0 .