I m using a template library from Phil Sturgeon. I also use modules.
模块博客只有在我增加时才会奏效。
$this->template->set_theme( nvc );
$this->template->set_layout( theme );
但我不想这样做,我想在核心文件中确定这一点。 我应如何确定这一点?
模块欢迎工作
class Welcome extends NVC_Controller {
function index()
{
$this->template->build( theme );
}
}
但模块博客有错误(图象):
无法装载所要求的档案:违约。
class Blog extends NVC_Controller {
var $num = 10;
function __construct()
{
$this->load->model( blog_model , blog );
}
function index()
{
$data["result"] = $this->blog->get_all_posts($this->num);
$this->template->build( blog , $data);
}
}
核心/NVC_Controller.php
class NVC_Controller extends MX_Controller {
function __construct(){
if(nvc_site_open()){
$this->template->set_theme( nvc );
$this->template->set_layout( theme );
} else {
show_error("De site is momenteel gesloten.");
}
}
}
What is going wrong? Setting the config layout to "theme" also doesn t work.
The template is stored in application/themes/nvc/views/layouts/theme.php
.