工作原理是 访问主页》读配置项》返回配置项内容》生成页面
现在是这个问题,配置项读不出来了。
代码展示:
\Home\Conf\Config.php的代码
<?php
return array(
'web_name' => 'Index',
);
?>\Home\Lib\Action\IndexActoin.class.php的代码<?php
class IndexAction extends Action {
public function index(){
$web_name=C('web_name');
$this->assign('name',$web_name);
$this->display();
}
}
?>\Home\Tpl\index\index.php的代码<html>
<head>
<title>欢迎来到{$name}</title>我是想做一个可以读配置项,然后在首页输出配置项里的内容,可是配置项读不出来。求教
最佳答案