get and set kohana config value during real time manipulation

You can now directly set and get the config value of Kohana by this way:

Set Config value in Kohana:

Kohana::config_set(filename.variablename, value);

for example:

suppose we want to change language  from Danish to English

Kohana::config_set(‘locale.language’, array(‘en-us’,'United States’));

here locale is config filename while language is variable which lies in locale.php.  You can set value in both array and string.

Get Config value in Kohana:

Kohana::config(filename.variablename);

for example:

To get current language then we use below script

Kohana::config(‘locale.language’);

About the Author

admin