symfony API

sfOutputEscaperObjectDecorator Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.1 API OpenSearch

Packages

You are currently browsing the symfony API for the 1.1 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.

Output escaping object decorator that intercepts all method calls and escapes

Inheritence

sfOutputEscaperIteratorDecorator  <  sfOutputEscaperObjectDecorator  <  sfOutputEscaperGetterDecorator < sfOutputEscaper

Method Summary

  • mixed getRaw($key)
    Returns the result of calling the get() method on the object, bypassing
  • mixed __call($method, $args)
    Magic PHP method that intercepts method calls, calls them on the objects
  • string __toString()
    Try to call decorated object __toString() method if exists.

Methods inherited from sfOutputEscaperGetterDecorator

get , getRaw

Methods inherited from sfOutputEscaper

escape , getRawValue , isClassMarkedAsSafe , markClassAsSafe , markClassesAsSafe , __construct , __get

Method Details

  • (mixed) getRaw ($key) Browse code

    $key The parameter to be passed to the get() get method

    Returns the result of calling the get() method on the object, bypassing

    any escaping, if that method exists.

    If there is not a callable get() method this will throw an exception.

    returns The unescaped value returned

    throws sfException if the object does not have a callable get() method

  • (mixed) __call ($method, $args) Browse code

    $method The method on the object to be called
    $args An array of arguments to be passed to the method

    Magic PHP method that intercepts method calls, calls them on the objects

    that is being escaped and escapes the result.

    The calling of the method is changed slightly to accommodate passing a
    specific escaping strategy. An additional parameter is appended to the
    argument list which is the escaping strategy. The decorator will remove
    and use this parameter as the escaping strategy if it begins with 'esc_'
    (the prefix all escaping helper functions have).

    For example if an object, $o, implements methods a() and b($arg):

    $o->a() // Escapes the return value of a()
    $o->a(ESC_RAW) // Uses the escaping method ESC_RAW with a()
    $o->b('a') // Escapes the return value of b('a')
    $o->b('a', ESC_RAW); // Uses the escaping method ESC_RAW with b('a')

    returns The escaped value returned by the method

  • (string) __toString () Browse code

    Try to call decorated object __toString() method if exists.