Zend_Form_Decorator_Element_HtmlTag

Wraps content in an HTML block tag.

Options accepted are:

  • tag: tag to use in decorator
  • noAttribs: do not render attributes in the opening tag
  • placement: 'append' or 'prepend'. If 'append', renders opening and closing tag after content; if prepend, renders opening and closing tag before content.
  • openOnly: render opening tag only
  • closeOnly: render closing tag only

Any other options passed are processed as HTML attributes of the tag.

category Zend
package Zend_Form
subpackage Decorator
copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
license New BSD License
version $Id$
inherited_from \Zend_Form_Decorator_Abstract

 Methods

Constructor

__construct(array|\Zend_Config $options = null) : void
Inherited

Accept options during initialization.

inherited_from \Zend_Form_Decorator_Interface::__construct()

Parameters

$options

array\Zend_Config

Clear all options

clearOptions() : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::clearOptions()

Returns

\Zend_Form_Decorator_Abstract

Retrieve current element

getElement() : \Zend_Form_Element | \Zend_Form
Inherited
inherited_from \Zend_Form_Decorator_Interface::getElement()

Returns

\Zend_Form_Element\Zend_Form

Get option

getOption(string $key) : mixed
Inherited
inherited_from \Zend_Form_Decorator_Interface::getOption()

Parameters

$key

string

Returns

mixed

Retrieve options

getOptions() : array
Inherited
inherited_from \Zend_Form_Decorator_Interface::getOptions()

Returns

array

Determine if decorator should append or prepend content

getPlacement() : string
Inherited

Returns

string

Retrieve separator to use between old and new content

getSeparator() : string
Inherited

Returns

string

Get tag

getTag() : string

If no tag is registered, either via setTag() or as an option, uses 'div'.

Returns

string

Normalize tag

normalizeTag(string $tag) : string

Ensures tag is alphanumeric characters only, and all lowercase.

Parameters

$tag

string

Returns

string

Remove single option

removeOption(mixed $key) : void
Inherited
inherited_from \Zend_Form_Decorator_Interface::removeOption()

Parameters

$key

mixed

Render content wrapped in an HTML tag

render(string $content) : string
inherited_from \Zend_Form_Decorator_Abstract::render()

Parameters

$content

string

Returns

string

Decorate content and/or element

render(string $content) : string
Inherited
inherited_from \Zend_Form_Decorator_Interface::render()

Parameters

$content

string

Exceptions

\Zend_Form_Decorator_Exception when unimplemented

Returns

string

Set options from config object

setConfig(\Zend_Config $config) : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::setConfig()

Parameters

$config

\Zend_Config

Returns

\Zend_Form_Decorator_Abstract

Set current form element

setElement(\Zend_Form_Element|\Zend_Form $element) : \Zend_Form_Decorator_Abstract
Inherited

While the name is "setElement", a form decorator could decorate either an element or a form object.

inherited_from \Zend_Form_Decorator_Interface::setElement()

Parameters

$element

\Zend_Form_Element\Zend_Form

Exceptions

\Zend_Form_Decorator_Exception on invalid element type

Returns

\Zend_Form_Decorator_Abstract

Set option

setOption(string $key, mixed $value) : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::setOption()

Parameters

$key

string

$value

mixed

Returns

\Zend_Form_Decorator_Abstract

Set options

setOptions(array $options) : \Zend_Form_Decorator_Abstract
Inherited
inherited_from \Zend_Form_Decorator_Interface::setOptions()

Parameters

$options

array

Returns

\Zend_Form_Decorator_Abstract

Set tag to use

setTag(string $tag) : \Zend_Form_Decorator_HtmlTag

Parameters

$tag

string

Returns

\Zend_Form_Decorator_HtmlTag

Get formatted closing tag

_getCloseTag(string $tag) : string

Parameters

$tag

string

Returns

string

Get encoding for use with htmlspecialchars()

_getEncoding() : string

Returns

string

Get the formatted open tag

_getOpenTag(string $tag, array $attribs = null) : string

Parameters

$tag

string

$attribs

array

Returns

string

Convert options to tag attributes

_htmlAttribs(array $attribs) : string

Parameters

$attribs

Returns

string

 Properties

 

$_element

$_element : \Zend_Form_Element | \Zend_Form

Default

 

Character encoding to use when escaping attributes

$_encoding : string

Default

 

Decorator options

$_options : array

Default

array()
 

Placement; default to surround content

$_placement : string

Default

null
inherited_from \Zend_Form_Decorator_Abstract::_placement
 

Default placement: append

$_placement : string

Default

'APPEND'
 

Separator between new content and old

$_separator : string

Default

PHP_EOL
 

HTML tag to use

$_tag : string

Default

 

$_tagFilter

$_tagFilter : \Zend_Filter

Default

 Constants

 

Placement constants

APPEND = 'APPEND' 
 

PREPEND

PREPEND = 'PREPEND'