symfony API

PartialHelper 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:

PartialHelper.

Function Summary

  • end_slot()
    Stops the content capture and save the content in the slot.
  • string get_component($moduleName, $componentName, $vars)
    Evaluates and returns a component.
  • string get_component_slot($name, $vars)
    Evaluates and returns a component slot.
  • string get_partial($templateName, $vars)
    Evaluates and returns a partial.
  • string get_slot($name, $default)
    Evaluates and returns a slot.
  • bool has_component_slot()
    Returns true if component slot exists.
  • bool has_slot($name)
    Returns true if the slot exists.
  • include_component($moduleName, $componentName, $vars)
    Evaluates and echoes a component.
  • include_component_slot(, )
    Evaluates and echoes a component slot.
  • include_partial($templateName, $vars)
    Evaluates and echoes a partial.
  • include_slot($name, $default)
    Evaluates and echoes a slot.
  • slot($name, $value)
    Begins the capturing of the slot.
  • _call_component()

Function Details

  • end_slot () Browse code

    Stops the content capture and save the content in the slot.

  • (string) get_component ($moduleName, $componentName, $vars) Browse code

    $moduleName module name
    $componentName component name
    $vars variables to be made accessible to the component

    Evaluates and returns a component.

    The syntax is similar to the one of include_component.

    Example:

    echo get_component('mymodule', 'mypartial', array('myvar' => 12345));

    returns result of the component execution

  • (string) get_component_slot ($name, $vars) Browse code

    $name slot name
    $vars variables to be made accessible to the component

    Evaluates and returns a component slot.

    The syntax is similar to the one of include_component_slot.

    Example:

    echo get_component_slot('sidebar', array('myvar' => 12345));

    returns result of the component execution

  • (string) get_partial ($templateName, $vars) Browse code

    $templateName partial name
    $vars variables to be made accessible to the partial

    Evaluates and returns a partial.

    The syntax is similar to the one of include_partial

    Example:

    echo get_partial('mypartial', array('myvar' => 12345));

    returns result of the partial execution

  • (string) get_slot ($name, $default) Browse code

    $name slot name
    $default default content to return if slot is unexistent

    Evaluates and returns a slot.


    Example:

    echo get_slot('navigation');

    returns content of the slot

  • (bool) has_component_slot () Browse code

    Returns true if component slot exists.

    returns true if component slot exists, false otherwise

  • (bool) has_slot ($name) Browse code

    $name slot name

    Returns true if the slot exists.

    returns true, if the slot exists

  • include_component ($moduleName, $componentName, $vars) Browse code

    $moduleName module name
    $componentName component name
    $vars variables to be made accessible to the component

    Evaluates and echoes a component.

    For a variable to be accessible to the component and its partial,
    it has to be passed in the third argument.

    Example:

    include_component('mymodule', 'mypartial', array('myvar' => 12345));

  • include_component_slot (, ) Browse code

    Evaluates and echoes a component slot.

    The component name is deduced from the definition of the view.yml
    For a variable to be accessible to the component and its partial,
    it has to be passed in the second argument.

    Example:

    include_component_slot('sidebar', array('myvar' => 12345));

  • include_partial ($templateName, $vars) Browse code

    $templateName partial name
    $vars variables to be made accessible to the partial

    Evaluates and echoes a partial.

    The partial name is composed as follows: 'mymodule/mypartial'.
    The partial file name is _mypartial.php and is looked for in modules/mymodule/templates/.
    If the partial name doesn't include a module name,
    then the partial file is searched for in the caller's template/ directory.
    If the module name is 'global', then the partial file is looked for in myapp/templates/.
    For a variable to be accessible to the partial, it has to be passed in the second argument.

    Example:

    include_partial('mypartial', array('myvar' => 12345));

  • include_slot ($name, $default) Browse code

    $name slot name
    $default default content to return if slot is unexistent

    Evaluates and echoes a slot.


    Example:

    include_slot('navigation');

  • slot ($name, $value) Browse code

    $name slot name
    $value The slot content

    Begins the capturing of the slot.

  • _call_component () Browse code