symfony API

PartialHelper Functions

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

1.2 API OpenSearch

Packages

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

PartialHelper.

Function Summary

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

Function Details

  • end_slot () Browse code

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

  • (string) get_component ($moduleName, $componentName, $vars = array()) 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 = array()) 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 = array()) 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) Browse code

    $name slot name

    Evaluates and returns a slot.


    Example:

      echo get_slot('navigation');

    returns content of the slot

  • (bool) has_component_slot ($name) Browse code

    $name slot name

    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 = array()) 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 ($name, $vars = array()) Browse code

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

    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 = array()) 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) Browse code

    $name slot name

    Evaluates and echoes a slot.


    Example:

      include_slot('navigation');

  • slot ($name, $value = null) Browse code

    $name slot name
    $value The slot content

    Begins the capturing of the slot.

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

    $moduleName
    $componentName
    $vars