在kohana中阅读配置文件3.2

时间:2012-07-02 07:57:23

标签: php kohana kohana-3 kohana-3.2

朋友们,我知道如何在kohana 3.0中阅读配置文件 我的代码是

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

此处ratnaconfig file,如下所示

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

我的问题是如何在kohana 3.2中读取相同的文件

Kohana::config('ratna'); method is not working in 3.2

2 个答案:

答案 0 :(得分:3)

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

您可以在official docs

中找到更多信息

答案 1 :(得分:0)

您可以通过Config加载功能来完成。

$config =     Kohana::$config->load('database');
//To get Specific Value
//$value = $config->get('Your_Variable');
$name  = $config->get('name');
相关问题