Configuration OverviewTuesday, November 25, 2014 8:28 AM
There are two ways to apply settings to your Yee application. First during Yee application instantiation and second after instantiation. All settings can be applied at instantiation time by passing Yees’s constructor an associative array. All settings can be retrieved and modified after instantiation, however some of them can not be done simply by using the config application instance method but will be demonstrated as necessary below. Before we list the available settings, it is worth to quickly explain how you may define and inspect settings with your Yee application.
To define settings upon instantiation, pass an associative array into the Yee constructor.
<?php $app = new Yee(array( 'debug' => true ));
To define settings after instantiation, the majority can use the config application instance method; the first argument is the setting name and the second argument is the setting value.
<?php $app->config('debug', false);
You may also define multiple settings at once using an associative array:
<?php $app->config(array( 'debug' => true, 'templates.path' => '../templates' ));
To retrieve the value of a setting within your code, you also use the config application instance method; however, you only pass one
argument - the name of the setting you wish to inspect. If the setting you request does not exist,
null is returned.
<?php $settingValue = $app->config('templates.path'); //returns "../templates"
You are not limited to the settings shown below; you may also define your own.