webCOMAND

controller::config()

Load a configuration file from the config/ folder.

Prototype

array config(string $name)

Parameters

  • name - Name of the configuration file, without the config folder path or the ".php" extension.

Return

An associative array of configuration options defined in the config file, or FALSE if the config could not be loaded.

Example

// the default controller method
public function web__index() {
    // load the configuration from config/storage.php
    $storage = $this->config('storage');
    echo('Storage size is: ' . $storage['size']);
}

Related

router::config(), loader::load_config()