Question

hi friends i know how to read config file in kohana 3.0 my code is

 $config_file = Kohana::config('ratna');
 $value = $config_file['name'];

here ratnais config file like below

    <?php defined('SYSPATH') or die('No direct script access.');
   return array(
     'name' => 'Clarence Ratna',
     'tag_line' => "Let's talk about me!",
       'qualification'=>"MCA"
   );

my question is how read same file in kohana 3.2 ???

Kohana::config('ratna'); method is not working in 3.2
Was it helpful?

Solution

Kohana::$config->load('ratna');  

You can find more information in official docs

OTHER TIPS

You can do it via Config load function.

$config =     Kohana::$config->load('database');
//To get Specific Value
//$value = $config->get('Your_Variable');
$name  = $config->get('name');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top