Application::loadConfig
Loading config file
Description
public void Application::loadConfig( string $name, string $languageCode = '' )
Load config file and assign to config variable on Controller.
Arguments
Name | Data type | Default | Remarks |
---|---|---|---|
$name | string | Configu file name | |
$languageCode | string | '' | Language code |
Example
code/config/sample.php
<?php
// You need to prepare same variable name with file name
$sample = array();
$sample['foo'] = 'bar';
$sample['baz'] = 'qux';
Controller
$this->loadConfig('sample');
var_dump($this->config['sample']);
Output
array(2) { ["foo"]=> string(3) "bar" ["baz"]=> string(3) "qux" }