Skip to main content

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

NameData typeDefaultRemarks
$namestringConfigu file name
$languageCodestring''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" }