API Documentation

Zend/Form/Decorator/Label.php

Show: inherited
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-2012 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 - opt(ional)Prefix: a prefix to the label to use when the element is optional - opt(iona)lSuffix: 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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Version
$Id: Label.php 24594 2012-01-05 21:27:01Z matthew $  

Properties

Propertyprotectedstring  $_placement= ''PREPEND''

Default placement: prepend

Default value'PREPEND'Details
Type
string
Propertyprotectedstring  $_tag= ''

HTML tag with which to surround label

Details
Type
string
Propertyprotectedstring  $_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
Name Type Description
$method string
$args array
Returns
Type Description
mixed
Throws
Exception Description
\Zend_Form_Exception for unsupported methods
methodprotected_loadOptReqKey( string $key ) : void

Load an optional/required suffix/prefix key

Parameters
Name Type Description
$key string
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
Type Description
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
Type Description
string
methodpublicgetLabel( ) : string

Get label to render

Returns
Type Description
string
methodpublicgetTag( ) : void

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

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
Name Type Description
$content string
Returns
Type Description
string
methodpublicsetId( string $id ) : \Zend_Form_Decorator_Label

Set element ID

Parameters
Name Type Description
$id string
Returns
Type Description
\Zend_Form_Decorator_Label
methodpublicsetTag( string $tag ) : \Zend_Form_Decorator_Label

Set HTML tag with which to surround label

Parameters
Name Type Description
$tag string
Returns
Type Description
\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
Name Type Description
$tagClass string
Returns
Type Description
\Zend_Form_Decorator_Label
Documentation was generated by DocBlox 0.15.1.