Codeigniter multiple views in one view

允我心安 提交于 2019-12-04 05:46:57

one approach is to have a template view that has the elements you require. see this pseudo-code example... so, template_view.php has:

$this->load->view('header',$header);    
$this->load->view('quicksearch',$quickssearch);    
$this->load->view('body',$body);    
$this->load->view('footer',$footer);

your single controller then calls the template with the parameters for each view.

$data = new stdClass();
$data->header = ....
$data->quickssearch = ....
$data->body = .....
$data->footer = .....

$this->load->view('template_view',$data);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!