2012-07-02 168 views
1

喜的朋友,我知道如何在Kohana的3.0读取配置文件 我的代码是读取配置文件3.2

$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 

回答

0

更多信息您可以通过配置负载功能做到这一点。

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