Pergunta

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
Foi útil?

Solução

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

You can find more information in official docs

Outras dicas

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');
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top