symfony API

TagHelper Functions

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to API menu


You are currently browsing the symfony API for the 1.4 version. Switch to:
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

TagHelper defines some base helpers to construct html tags.

Function Summary

Function Details

  • cdata_section ()

  • (string) comment_as_conditional ($condition, $content)

    Wraps the content in conditional comments.

  • content_tag ()

  • escape_javascript ()

    Escape carrier returns and single and double quotes for Javascript segments.

  • (string) escape_once ($html)

    $html HTML string to escape

    Escapes an HTML string.

    returns escaped string

  • (string) fix_double_escape ($escaped)

    $escaped HTML string to fix

    Fixes double escaped strings.

    returns fixed escaped string

  • (string) get_id_from_name ($name, $value)

    $name field name
    $value field value

    Returns a formatted ID based on the <i>$name</i> parameter and optionally the <i>$value</i> parameter.

    This function determines the proper form field ID name based on the parameters. If a form field has an
    array value as a name we need to convert them to proper and unique IDs like so:

    name[] => name (if value == null)
    name[] => name_value (if value != null)
    name[bob] => name_bob
    name[item][total] => name_item_total


    echo get_id_from_name('status[]', '1');


    $name tag name
    $options tag options
    $open true to leave tag open

    Constructs an html tag.

  • (array) _convert_options ($options)

    Converts specific <i>$options</i> to their correct HTML format

    returns returns properly formatted options

  • _get_option ()

  • _parse_attributes ()

  • _tag_options ()