Form/Decorator/Label.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 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\Decorator
Zend_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

>VConstant  IMPLICIT = 'IMPLICIT'
Placement constants
>VConstant  IMPLICIT_PREPEND = 'IMPLICIT_PREPEND'
>VConstant  IMPLICIT_APPEND = 'IMPLICIT_APPEND'

Properties

>VPropertyprotectedstring $_placement = 'PREPEND'
Default placement: prepend
Default value'PREPEND'Details
Type
string
>VPropertyprotectedstring $_tag
HTML tag with which to surround label
Details
Type
string
>VPropertyprotectedstring $_tagClass
Class for the HTML tag with which to surround label
Details
Type
string

Methods

methodpublic__call(string $method, array $args) : mixed

Overloading

Currently overloads: - getOpt(ional)Prefix() - getOpt(ional)Suffix() - getReq(uired)Prefix() - getReq(uired)Suffix() - setOpt(ional)Prefix() - setOpt(ional)Suffix() - setReq(uired)Prefix() - setReq(uired)Suffix()
Parameters
NameTypeDescription
$methodstring
$argsarray
Returns
TypeDescription
mixed
Throws
ExceptionDescription
\Zend_Form_Exceptionfor unsupported methods
methodprotected_loadOptReqKey(string $key) : void

Load an optional/required suffix/prefix key

Parameters
NameTypeDescription
$keystring
methodpublicgetClass() : string

Get class with which to define label

Appends either 'optional' or 'required' to class, depending on whether or not the element is required.
Returns
TypeDescription
string
methodpublicgetId() : string

Retrieve element ID (used in 'for' attribute)

If none set in decorator, looks first for element 'id' attribute, and defaults to element name.
Returns
TypeDescription
string
methodpublicgetLabel() : string

Get label to render

Returns
TypeDescription
string
methodpublicgetPlacement() : string

Determine if label should append, prepend or implicit content

Returns
TypeDescription
string
methodpublicgetTag() : string

Get HTML tag, if any, with which to surround label

Returns
TypeDescription
string
methodpublicgetTagClass() : void

Get the class to apply to the HTML tag, if any, with which to surround label

methodpublicrender(string $content) : string

Render a label

Parameters
NameTypeDescription
$contentstring
Returns
TypeDescription
string
methodpublicsetId(string $id) : \Zend_Form_Decorator_Label

Set element ID

Parameters
NameTypeDescription
$idstring
Returns
TypeDescription
\Zend_Form_Decorator_Label
methodpublicsetTag(string $tag) : \Zend_Form_Decorator_Label

Set HTML tag with which to surround label

Parameters
NameTypeDescription
$tagstring
Returns
TypeDescription
\Zend_Form_Decorator_Label
methodpublicsetTagClass(string $tagClass) : \Zend_Form_Decorator_Label

Set the class to apply to the HTML tag with which to surround label

Parameters
NameTypeDescription
$tagClassstring
Returns
TypeDescription
\Zend_Form_Decorator_Label
Documentation was generated by phpDocumentor 2.2.0 .