PHP Класс Horde_View_Helper_Tag, horde

By default, they output HTML 4.01 Strict compliant tags.
Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
Автор: Chuck Hagenbuch ([email protected])
Наследование: extends Horde_View_Helper_Base
Показать файл Открыть проект

Открытые методы

Метод Описание
cdataSection ( string $content ) : string Returns a CDATA section with the given $content.
contentTag ( string $name, string $content, array $options = null ) : string Returns an HTML block tag of type $name surrounding the $content.
escape ( string $var ) : string Escapes a value for output in a view template.
escapeOnce ( string $html ) : string Returns the escaped $html without affecting existing escaped entities.
tag ( string $name, string $options = null ) : string Returns an empty HTML tag of type $name.
tagOptions ( array $options ) : string Converts an associative array of $options into a string of HTML attributes.

Приватные методы

Метод Описание
_fixDoubleEscape ( string $escaped ) : string Fix double-escaped entities, such as &, {, etc.

Описание методов

cdataSection() публичный Метод

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(''); => ]]>
public cdataSection ( string $content ) : string
$content string Content for inside CDATA section.
Результат string CDATA section with content.

contentTag() публичный Метод

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)) =>
public contentTag ( string $name, string $content, array $options = null ) : string
$name string Tag name.
$content string Content to place between the tags.
$options array Tag attributes.
Результат string Generated HTML tags with content between.

escape() публичный Метод

escape($this->templateVar) ?>

public escape ( string $var ) : string
$var string The output to escape.
Результат string The escaped value.

escapeOnce() публичный Метод

$this->escapeOnce('1 > 2 & 3') => '1 < 2 & 3'
public escapeOnce ( string $html ) : string
$html string HTML to be escaped.
Результат string Escaped HTML without affecting existing escaped entities.

tag() публичный Метод

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)) =>
public tag ( string $name, string $options = null ) : string
$name string Tag name.
$options string Tag attributes.
Результат string Generated HTML tag.

tagOptions() публичный Метод

Converts an associative array of $options into a string of HTML attributes.
public tagOptions ( array $options ) : string
$options array Key/value pairs.
Результат string 'key1="value1" key2="value2"'