symfony API

EscapingHelper Functions

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.4 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.4 version. Switch to:

The functions are primarily used by the output escaping component.

Function Summary

  • string esc_entities($value)
    Runs the PHP function htmlentities on the value passed.
  • string esc_js($value)
    A function that c-escapes a string after applying {@link esc_entities()}. The
  • string esc_js_no_entities($value)
    A function the c-escapes a string, making it suitable to be placed in a
  • string esc_raw($value)
    An identity function that merely returns that which it is given, the purpose
  • string esc_specialchars($value)
    Runs the PHP function htmlspecialchars on the value passed.

Function Details

  • (string) esc_entities ($value) Browse code

    $value the value to escape

    Runs the PHP function htmlentities on the value passed.

    returns the escaped value

  • (string) esc_js ($value) Browse code

    $value the value to escape

    A function that c-escapes a string after applying {@link esc_entities()}. The

    assumption is that the value will be used to generate dynamic HTML in some
    way and the safest way to prevent mishap is to assume the value should have
    HTML entities set properly.

    The {@link esc_js_no_entities()} method should be used to escape a string
    that is ultimately not going to end up as text in an HTML document.

    returns the escaped value

  • (string) esc_js_no_entities ($value) Browse code

    $value the value to escape

    A function the c-escapes a string, making it suitable to be placed in a

    JavaScript string.

    returns the escaped value

  • (string) esc_raw ($value) Browse code

    $value the value to escape

    An identity function that merely returns that which it is given, the purpose

    being to be able to specify that the value is not to be escaped in any way.

    returns the escaped value

  • (string) esc_specialchars ($value) Browse code

    $value the value to escape

    Runs the PHP function htmlspecialchars on the value passed.

    returns the escaped value