Documentation

Horde_View_Helper_Form_InstanceTag_Base extends Horde_View_Helper_Tag
in package

Use these methods to generate HTML tags programmatically.

Tags
author

Mike Naberezny mike@maintainable.com

author

Derek DeVries derek@maintainable.com

author

Chuck Hagenbuch chuck@horde.org

license

http://www.horde.org/licenses/bsd

category

Horde

subpackage

Helper

Table of Contents

$_defaultDateOptions  : mixed
$_defaultFieldOptions  : mixed
$_defaultRadioOptions  : mixed
$_defaultTextAreaOptions  : mixed
$_view  : Horde_View
The parent view invoking the helper.
$autoIndex  : mixed
$object  : mixed
$objectName  : mixed
$objectProperty  : mixed
$_booleanAttributes  : array<string|int, mixed>
Boolean HTML attributes.
__call()  : mixed
Call chaining so members of the view can be called (including other helpers).
__construct()  : mixed
__get()  : mixed
Proxy on undefined property access (get).
__set()  : mixed
Proxy on undefined property access (set).
cdataSection()  : string
Returns a CDATA section with the given $content.
contentTag()  : string
Returns an HTML block tag of type $name surrounding the $content.
escape()  : string
Escapes a value for output in a view template.
escapeOnce()  : string
Returns the escaped $html without affecting existing escaped entities.
object()  : mixed
tag()  : string
Returns an empty HTML tag of type $name.
tagOptions()  : string
Converts an associative array of $options into a string of HTML attributes.
value()  : mixed
addDefaultNameAndId()  : mixed
sanitizedObjectName()  : mixed
tagId()  : mixed
tagIdWithIndex()  : mixed
tagName()  : mixed
tagNameWithIndex()  : mixed
valueBeforeTypeCast()  : mixed
_fixDoubleEscape()  : string
Fix double-escaped entities, such as &amp;amp;, &amp;#123;, etc.

Properties

$_defaultDateOptions

protected mixed $_defaultDateOptions = array('discardType' => \true)

$_defaultFieldOptions

protected mixed $_defaultFieldOptions = array('size' => 30)

$_defaultRadioOptions

protected mixed $_defaultRadioOptions = array()

$_defaultTextAreaOptions

protected mixed $_defaultTextAreaOptions = array('cols' => 40, 'rows' => 20)

$autoIndex

protected mixed $autoIndex

$object

protected mixed $object

$objectName

protected mixed $objectName

$objectProperty

protected mixed $objectProperty

$_booleanAttributes

Boolean HTML attributes.

private array<string|int, mixed> $_booleanAttributes = array('checked', 'disabled', 'multiple', 'readonly', 'selected')

Methods

__call()

Call chaining so members of the view can be called (including other helpers).

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string

The method.

$args : array<string|int, mixed>

The parameters for the method.

Return values
mixed

The result of the method.

__construct()

public __construct(mixed $objectName, mixed $objectProperty, mixed $view[, mixed $object = null ]) : mixed
Parameters
$objectName : mixed
$objectProperty : mixed
$view : mixed
$object : mixed = null
Return values
mixed

__get()

Proxy on undefined property access (get).

public __get(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

__set()

Proxy on undefined property access (set).

public __set(mixed $name, mixed $value) : mixed
Parameters
$name : mixed
$value : mixed
Return values
mixed

cdataSection()

Returns a CDATA section with the given $content.

public cdataSection(string $content) : string

CDATA sections are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string "".

$this->cdataSection(''); // => ]]>
Parameters
$content : string

Content for inside CDATA section.

Return values
string

CDATA section with content.

contentTag()

Returns an HTML block tag of type $name surrounding the $content.

public contentTag(string $name, string $content[, array<string|int, mixed> $options = null ]) : string

Add HTML attributes by passing an attributes hash to $options. For attributes with no value (like disabled and readonly), give it a value of TRUE in the $options array.

$this->contentTag('p', 'Hello world!') // =>

Hello world!

$this->contentTag('div', $this->contentTag('p', 'Hello world!'), array('class' => 'strong')) // =>

Hello world!

$this->contentTag('select', $options, array('multiple' => true)) // =>
Parameters
$name : string

Tag name.

$content : string

Content to place between the tags.

$options : array<string|int, mixed> = null

Tag attributes.

Return values
string

Generated HTML tags with content between.

escape()

Escapes a value for output in a view template.

public escape(string $var) : string

escape($this->templateVar) ?>

Parameters
$var : string

The output to escape.

Return values
string

The escaped value.

escapeOnce()

Returns the escaped $html without affecting existing escaped entities.

public escapeOnce(string $html) : string
$this->escapeOnce('1 > 2 & 3') // => '1 < 2 & 3'
Parameters
$html : string

HTML to be escaped.

Return values
string

Escaped HTML without affecting existing escaped entities.

object()

public object() : mixed
Return values
mixed

tag()

Returns an empty HTML tag of type $name.

public tag(string $name[, string $options = null ]) : string

Add HTML attributes by passing an attributes hash to $options. For attributes with no value (like disabled and readonly), give it a value of TRUE in the $options array.

$this->tag('br') // =>
$this->tag('input', array('type' => 'text', 'disabled' => true)) // =>
Parameters
$name : string

Tag name.

$options : string = null

Tag attributes.

Return values
string

Generated HTML tag.

tagOptions()

Converts an associative array of $options into a string of HTML attributes.

public tagOptions(array<string|int, mixed> $options) : string
Parameters
$options : array<string|int, mixed>

Key/value pairs.

Return values
string

'key1="value1" key2="value2"'

value()

public value(mixed $object) : mixed
Parameters
$object : mixed
Return values
mixed

addDefaultNameAndId()

protected addDefaultNameAndId(mixed $options) : mixed
Parameters
$options : mixed
Return values
mixed

sanitizedObjectName()

protected sanitizedObjectName() : mixed
Return values
mixed

tagId()

protected tagId() : mixed
Return values
mixed

tagIdWithIndex()

protected tagIdWithIndex(mixed $index) : mixed
Parameters
$index : mixed
Return values
mixed

tagName()

protected tagName() : mixed
Return values
mixed

tagNameWithIndex()

protected tagNameWithIndex(mixed $index) : mixed
Parameters
$index : mixed
Return values
mixed

valueBeforeTypeCast()

protected valueBeforeTypeCast(mixed $object) : mixed
Parameters
$object : mixed
Return values
mixed

_fixDoubleEscape()

Fix double-escaped entities, such as &amp;amp;, &amp;#123;, etc.

private _fixDoubleEscape(string $escaped) : string
Parameters
$escaped : string

Double-escaped entities.

Return values
string

Entities fixed.

Search results