symfony API

sfParameterHolder Class

« Back to API menu

1.0 API OpenSearch

Packages

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

sfParameterHolder provides a base class for managing parameters.

Method Summary

  • removeNamespace($ns = null)
    Remove A parameter namespace and all of its associated parameters.
  • array getNamespaces()
    Retrieve an array of parameter namespaces.
  • __construct($namespace = 'symfony/default')
    The constructor for sfParameterHolder.
  • array& getAll($ns = null)
    Retrieve an array of parameters, within a namespace.
  • string getDefaultNamespace()
    Get the default namespace value.
  • add($parameters, $ns = null)
    Set an array of parameters.
  • setByRef($name, [[[amp]]]$value, $ns = null)
    Set a parameter by reference.
  • mixed& get($name, $default = null, $ns = null)
    Retrieve a parameter with an optionally specified namespace.
  • array getNames($ns = null)
    Retrieve an array of parameter names from an optionally specified namespace.
  • string& remove($name, $ns = null)
    Remove a parameter.
  • set($name, $value, $ns = null)
    Set a parameter.
  • addByRef([[[amp]]]$parameters, $ns = null)
    Set an array of parameters by reference.
  • bool hasNamespace($ns)
    Indicates whether or not A parameter namespace exists.
  • clear()
    Clear all parameters associated with this request.
  • bool has($name, $ns = null)
    Indicates whether or not a parameter exists.

Method Details

  • removeNamespace ($ns = null) Browse code

    $ns A parameter namespace.

    Remove A parameter namespace and all of its associated parameters.

  • (array) getNamespaces () Browse code

    Retrieve an array of parameter namespaces.

    returns An indexed array of parameter namespaces.

  • __construct ($namespace = 'symfony/default') Browse code

    $namespace

    The constructor for sfParameterHolder.

    The default namespace may be overridden at initialization as follows:

     <?php
    
    $mySpecialPH = new sfParameterHolder('symfony/special');
    ?>

  • (array&amp;) getAll ($ns = null) Browse code

    $ns A parameter namespace.

    Retrieve an array of parameters, within a namespace.

    This method is limited to a namespace. Without any argument, it returns the parameters of the default namespace. If a namespace is passed as an argument, only the parameters of the specified namespace are returned.

    returns An associative array of parameters.

  • (string) getDefaultNamespace () Browse code

    Get the default namespace value.

    The $default_namespace is defined as 'symfony/default'.

    returns The default namespace.

  • add ($parameters, $ns = null) Browse code

    $parameters An associative array of parameters and their associated values.
    $ns A parameter namespace.

    Set an array of parameters.

    If an existing parameter name matches any of the keys in the supplied array, the associated value will be overridden.

  • setByRef ($name, [[[amp]]]$value, $ns = null) Browse code

    $name A parameter name.
    [[[amp]]]$value A reference to a parameter value.
    $ns A parameter namespace.

    Set a parameter by reference.

    If a parameter with the name already exists the value will be overridden.

  • (mixed&amp;) get ($name, $default = null, $ns = null) Browse code

    $name A parameter name.
    $default A default parameter value.
    $ns A parameter namespace.

    Retrieve a parameter with an optionally specified namespace.

    An isolated namespace may be identified by providing a value for the third argument. If not specified, the default namespace 'symfony/default' is used.

    returns A parameter value, if the parameter exists, otherwise null.

  • (array) getNames ($ns = null) Browse code

    $ns A parameter namespace.

    Retrieve an array of parameter names from an optionally specified namespace.

    returns An indexed array of parameter names, if the namespace exists, otherwise null.

  • (string&amp;) remove ($name, $ns = null) Browse code

    $name A parameter name.
    $ns A parameter namespace.

    Remove a parameter.

    returns A parameter value, if the parameter was removed, otherwise null.

  • set ($name, $value, $ns = null) Browse code

    $name A parameter name.
    $value A parameter value.
    $ns A parameter namespace.

    Set a parameter.

    If a parameter with the name already exists the value will be overridden.

  • addByRef ([[[amp]]]$parameters, $ns = null) Browse code

    [[[amp]]]$parameters An associative array of parameters and references to their associated values.
    $ns A parameter namespace.

    Set an array of parameters by reference.

    If an existing parameter name matches any of the keys in the supplied array, the associated value will be overridden.

  • (bool) hasNamespace ($ns) Browse code

    $ns A parameter namespace.

    Indicates whether or not A parameter namespace exists.

    returns true, if the namespace exists, otherwise false.

  • clear () Browse code

    Clear all parameters associated with this request.

  • (bool) has ($name, $ns = null) Browse code

    $name A parameter name.
    $ns A parameter namespace.

    Indicates whether or not a parameter exists.

    returns true, if the parameter exists, otherwise false.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.