【发布时间】:2017-04-30 21:32:34
【问题描述】:
我一直在尝试在 codeigniter 模板库中定义一个新的模板组,但我不断收到错误消息,提示该组不存在/尚未定义。下面是定义设置为活动的默认模板组的代码。
$template['default']['template'] = 'templates/welcome';
$template['default']['regions'] = array(
'header' => array('content' => array("<h1>Adrian's Branch</h1>")),
'content',
'footer' => array('content' => array('<p id="copyright">0bytes</p>'))
);
$template['default']['parser'] = 'parser';
$template['default']['parser_method'] = 'parse';
$template['default']['parse_template'] = FALSE;
我认为通过将“default”替换为我的自定义组名称来定义自定义组的方法相同?
在我的控制器中我调用...
$this->template->set_template('custom_template_name');
但这不起作用?我这样做对吗?
用户指南可以在这里找到:http://williamsconcepts.com/ci/codeigniter/libraries/template/reference.html
【问题讨论】:
标签: codeigniter templates