symfony API

EscapingHelper Functions

« Back to API menu

action

addon

cache

config

controller

countable

database

debug

exception

filter

generator

helper

i18n

log

request

response

storage

test

user

util

validator

view

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

The functions are primarily used by the output escaping component.

Function Summary

  • string esc_js($value)
    A function that c-escapes a string after applying . 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.
  • string esc_raw($value)
    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.
  • string esc_entities($value)
    Runs the PHP function htmlentities on the value passed.
  • string esc_js_no_entities($value)
    A function the c-escapes a string, making it suitable to be placed in a JavaScript string.

Function Details

  • (string) esc_js ($value)

    $value the value to escape

    A function that c-escapes a string after applying . 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 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_raw ($value)

    $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_entities ($value)

    $value the value to escape

    Runs the PHP function htmlentities on the value passed.

    returns the escaped value

  • (string) esc_js_no_entities ($value)

    $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