Form/Decorator/Label.php
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 license@zend.com 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_Form
- Subpackage
- Decorator
\Zend_Form_Decorator_Label
Package: Zend_Form\DecoratorZend_Form_Decorator_Label
Accepts the options:
- separator: separator to use between label and content (defaults to PHP_EOL)
- placement: whether to append or prepend label to content (defaults to prepend)
- tag: if set, used to wrap the label in an additional HTML tag
- tagClass: if tag option is set, used to add a class to the label wrapper
- opt(ional)Prefix: a prefix to the label to use when the element is optional
- opt(ional)Suffix: a suffix to the label to use when the element is optional
- req(uired)Prefix: a prefix to the label to use when the element is required
- req(uired)Suffix: a suffix to the label to use when the element is required
Any other options passed will be used as HTML attributes of the label tag.
- Parent(s)
- \Zend_Form_Decorator_Abstract
- Category
- Zend
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id$
Constants
IMPLICIT_PREPEND
= 'IMPLICIT_PREPEND'
IMPLICIT_APPEND
= 'IMPLICIT_APPEND'
Properties
string $_placement = 'PREPEND'
Default placement: prepend
Default value'PREPEND'
Details- Type
- string
Methods
_loadOptReqKey(string $key) : void
Load an optional/required suffix/prefix key
ParametersName | Type | Description |
---|
$key | string | |
---|
getClass() : string
Get class with which to define label
Appends either 'optional' or 'required' to class, depending on whether
or not the element is required.
ReturnsgetId() : string
Retrieve element ID (used in 'for' attribute)
If none set in decorator, looks first for element 'id' attribute, and
defaults to element name.
ReturnssetTag(string $tag) : \Zend_Form_Decorator_Label
Set HTML tag with which to surround label
ParametersName | Type | Description |
---|
$tag | string | |
---|
Returns setTagClass(string $tagClass) : \Zend_Form_Decorator_Label
Set the class to apply to the HTML tag with which to surround label
ParametersName | Type | Description |
---|
$tagClass | string | |
---|
Returns