Kohana 3.2 与 Kostache 胡子。
我是新来的。
我有这个看法
$this->config = Kohana::$config->load('information');
if(isset($this->config["techinfo"][Request::current()->param('product')]))
{
$response['techinfo']['param']=$this->config["techinfo"][Request::current()->param('product')]["param"];
}
在 Information.php 中,我有很多数据,例如名称、值、参数和其他内容。不要问我为什么。这个文件只有一个简单的返回数组,里面有数据信息。
这是做什么的:数组值的名称与 url 产品的名称相同。因此,如果是/brand/category/product-A
,则信息来自产品-A,如果是/brand/category/product-B
,则来自他的信息。
模板文件只有 {{#product}}{{#techinfo}}{{param}}{{/techinfo}}{{/product}}>
再说一遍:不要问我为什么,但它有效。我有这个网站这种方式。
我的问题:我需要使用同一个文件来获取信息。我可以这样做,但前提是我复制数据。我不想这样做。
在更新的视图中,但 $this->config = Kohana::$config->load('information');
它是相同的。但是我是如何从那里得到数据的呢?