.. _php/classes/config: Config ###### .. php:class:: Config Extends `FuelPHP config class `__ and provides new functionalities. ::mergeWithUser($key, $config) ------------------------------ .. php:staticmethod:: mergeWithUser($key, $config) :param string $key: Key in which the user's configuration is saved. :param mixed $config: Configuration to merge. :returns: The configuration merged. Merge configuration with the one saved in user in the key `$key`. ::getDbName($key) ------------------------------ .. php:staticmethod:: getDbName($key) :param string $key: Key to be transformed. :returns: Valid user configuration key. ::configFile($class) -------------------- .. php:staticmethod:: configFile($class) :param string $class: Class we want to retrieve the configuration from. :returns: Returns a two element array: first element is the class's application, and the second element is the relative path of the configuration file. ::metadata($application_name) ----------------------------- .. php:staticmethod:: metadata($application_name) :param string $application_name: Application we want to retrieve the metadata configuration from. :returns: The metadata configuration. ::application($application_name) -------------------------------- .. php:staticmethod:: application($application_name) :param string $application_name: Application we want to retrieve the global configuration from (located at `application::config`) :returns: The global configuration. ::actions($params) ------------------ .. php:staticmethod:: actions($params = array()) :param array $params: Set of filters on actions. :models: ``array`` Models on which we retrieve actions list. :item: ``object`` (optional) Item which we want to associate the actions with (will allow to process the ``disabled`` key). :all_targets: ``boolean`` Specify if we want to retrieve all actions (no matter target or visible value). :target: ``string`` Which target we want to filter the actions on. :returns: The filtered actions. ::getActionDisabledState($disabled, $item) ------------------------------------------ .. php:staticmethod:: getActionDisabledState($disabled, $item) :param mixed $disabled: Disabled value to be processed. :param object $item: Item necessary to process the disabled value. :returns: The processed disabled value. ::processCallbackValue($value, $positive_value, $argument_1, $argument_2, ...) ------------------------------------------------------------------------------ .. php:staticmethod:: getActionDisabledState($value, $positive_value, $argument_1, $argument_2, ...) :param mixed $value: Value to process. :param object $positive_value: If the value is an array of callbacks, it defines which value is expected. If callback return the expected value, then we call next callback. Otherwise, we return the value. :param mixed $arguments: All appended parameters are sent to the callback functions (if there is any). :returns: The first value which is different of `$positive_value`, otherwise `$positive_value`. For instance: .. code-block:: php