Class TagHelper

(line 24)

Description


Located in File: /AkActionView/helpers/tag_helper.php

Use these methods to generate HTML tags programmatically when you can't use a Builder.

By default, they output XHTML compliant tags.



Classes extended from TagHelper:
AkFormHelperInstanceTag
Use these methods to generate HTML tags programmatically when you can't use a Builder.

Class Variables

Summary:

Class Constants

Summary:

Method Detail

Summary:
void cdata_section ( $content)
void content_tag ( $name,  $content, [ $options = null])
void escape_once ( $html)
void tag ( $name, [ $options = null], [ $open = false])
void _fix_double_escape ( $escaped)
void _tag_options ( $options)

Method cdata_section (line 72)

void cdata_section( $content)

Returns a CDATA section for the given +content+. CDATA sections

are used to escape blocks of text containing characters which would otherwise be recognized as markup. CDATA sections begin with the string <tt>&lt;![CDATA[</tt> and } with (and may not contain) the string <tt>]]></tt>.

Parameters

  • $content:

Info

Method content_tag (line 60)

void content_tag( $name, $content, [ $options = null])

Overridden in child classes as:

ActiveRecordInstanceTag::content_tag()

Returns an HTML block tag of type *name* surrounding the *content*. Add HTML attributes by passing an attributes array to *options*. For attributes with no value like (disabled and readonly), give it a value of true in the *options* array. You can use symbols or strings for the attribute names.

<%= content_tag 'p', 'Hello world!' %>

  • =>
<p>Hello world!</p> <%= content_tag('div', content_tag('p', "Hello world!"), :class => "strong") %>
  • => <div class="strong">
<p>Hello world!</p></div> <%= content_tag("select", options, :multiple => true) %>
  • => <select multiple="multiple">...options...</select>

Parameters

  • $name:
  • $content:
  • $options:

Info

Method escape_once (line 84)

void escape_once( $html)

Returns the escaped +html+ without affecting existing escaped entities.

<%= escape_once "1 > 2 &amp; 3" %>

  • => "1 &gt; 2 &amp; 3"

Parameters

  • $html:

Info

Method tag (line 42)

void tag( $name, [ $options = null], [ $open = false])

Overridden in child classes as:

ActiveRecordInstanceTag::tag()

Returns an empty HTML tag of type *name* which by default is XHTML

compliant. Setting *open* to true will create an open tag compatible with HTML 4.0 and below. Add HTML attributes by passing an attributes array to *options*. For attributes with no value like (disabled and readonly), give it a value of true in the *options* array.

Examples:

<%= tag 'br' %>

  • =>
<%= tag 'br', null, true %>
  • =>
<%= tag 'input', { :type => 'text', :disabled => true } %>
  • => <input type="text" disabled="disabled" />

Parameters

  • $name:
  • $options:
  • $open:

Info

Method _fix_double_escape (line 96)

void _fix_double_escape( $escaped)

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

Parameters

  • $escaped:

Info

Method _tag_options (line 101)

void _tag_options( $options)

Parameters

  • $options:

Info

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary


Documentation generated on Sat, 06 Oct 2007 02:33:12 +0200 by phpDocumentor 1.3.2