symfony API

JavascriptBaseHelper Functions

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.3 API OpenSearch

Packages

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

JavascriptBaseHelper.

Function Summary

Function Details

  • (string) array_or_string_for_javascript () Browse code

    converts the given PHP array or string to the corresponding javascript array or string.

    javascript strings need to be single quoted.

    returns javascript string or array equivalent

  • (string) boolean_for_javascript () Browse code

    converts the given PHP boolean to the corresponding javascript boolean.

    booleans need to be true or false (php would print 1 or nothing).

    returns javascript boolean equivalent

  • button_to_function () Browse code

    Returns a button that will trigger a javascript function using the

    onclick handler and return false after the fact.

    Examples:

  • end_if_javascript () Browse code

    Mark the end of a block that should only be shown in the browser if JavaScript

    is switched on.

  • end_javascript_tag () Browse code

  • if_javascript () Browse code

    Mark the start of a block that should only be shown in the browser if JavaScript

    is switched on.

  • javascript_cdata_section () Browse code

  • javascript_tag () Browse code

    Returns a JavaScript tag with the '$content' inside. If no content is passed, it works as the slot() method and will output everythin between

    javascript_tag() and end_javascript_tag(),
    Example:

    =>
    alert('All is good')

  • link_to_function () Browse code

    Returns a link that will trigger a javascript function using the

    onclick handler and return false after the fact.

    Examples:

    'Really?')) ?>

  • (string) options_for_javascript () Browse code

    converts the the PHP options array into a javscript array

    returns javascript arry equivalent