|
发表于 2010-9-14 16:47:34
|
显示全部楼层
本帖最后由 kis 于 2010-9-14 16:48 编辑
晒一晒我的方法
-----------------------------------------------
在library/Controller 里面新增方法如下
protected function _html($title = "", $js = "common")
{
$html = array();
$html['header'] = $this->header($title, $js);
$html['footer'] = '';///
......(其他保密)
return $html;
}
public function header($title = "", $options = null, $file_name = "header")
{
$CI = & get_instance();
$html = array();
$html['title'] = $title;
。。。(其他保密)
return $CI->load->view($file_name, $html, true);
}
测试用例:控制器.php
function index(){
$html = $this->_html('测试', null);
$this->load->view('view_path', $html);
}
希望对你有一点用... |
评分
-
查看全部评分
|