symfony API

sfConfig Class

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to API menu

Packages

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

sfConfig stores all configuration information for a symfony application.

Method Summary

  • add($parameters)
    Sets an array of config parameters.
  • clear()
    Clears all current config parameters.
  • mixed get($name, $default)
    Retrieves a config parameter.
  • array getAll()
    Retrieves all configuration parameters.
  • bool has($name)
    Indicates whether or not a config parameter exists.
  • set($name, $value)
    Sets a config parameter.

Method Details

  • add ($parameters)

    $parameters An associative array of config parameters and their associated values

    Sets an array of config parameters.


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

  • clear ()

    Clears all current config parameters.

  • (mixed) get ($name, $default)

    $name A config parameter name
    $default A default config parameter value

    Retrieves a config parameter.

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

  • (array) getAll ()

    Retrieves all configuration parameters.

    returns An associative array of configuration parameters.

  • (bool) has ($name)

    $name A config parameter name

    Indicates whether or not a config parameter exists.

    returns true, if the config parameter exists, otherwise false

  • set ($name, $value)

    $name A config parameter name
    $value A config parameter value

    Sets a config parameter.


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