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.
Method Detail
Summary:
void
content_tag
(
$name,
$content, [
$options =
null])
void
tag
(
$name, [
$options =
null], [
$open =
false])
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><![CDATA[</tt> and } with (and may not contain) the string <tt>]]></tt>.
Parameters
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") %>
<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 & 3" %>
Parameters
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
Info
Method _fix_double_escape (line 96)
void _fix_double_escape(
$escaped)
Fix double-escaped entities, such as &amp;, &#123;, etc.
Parameters
Info
Method _tag_options (line 101)
void _tag_options(
$options)
Parameters
Info