Define variable in Kohana using Config File

How to make the global variable in Kohana –

To get the value of the variable which is used globally into the website. For it you have to set the variable in config file of Kohana.

For it, you have to open the file -

Kohana -> application->config-> config.php (Path of the config file)

For example -

I have to set the path of the image where it is stored in the folder.

$config['imgpath'] =’Kohana/images/picture/’;

To get the config value -

Kohana::config(‘config.imgpath’);

If you want to print the path -

echo Kohana::config(‘config.imgpath’);

About the Author

pallavi@witslog.com