2012-10-10 29 views
0

我设计用笨的模板库模板的模板库,模板具有以下区域:

$template['template_ar']['template'] = 'template_ar'; 
$template['template_ar']['regions'] = array(
    'header', 
    'title', 
    'content', 
    'topcontent', 
    'sidebar', 
    'footer', 
    'options', 
    'script', 
); 

我用下面的代码,以使我的模板

class faq extends MY_Controller { 
    /** 
    * Index 
    * This function views the Home Page 
    * 
    * @access public 
    * @return 
    */ 

    public function index() { 
    $this->template->write_view('content','comment/questions'); 
    $this->template->write('options','You one',TRUE);  
    $this->template->render(); 
    } 
} 

问题我想消除的是我想阻止顶级内容出现在我的模板中。我只需要内容,标题和页脚。谁能告诉我如何做到这一点?

+0

你能在这里http://scrp.at/分享您的库代码会对它的外观。 – umefarooq

+0

您使用哪个模板库? [williamsconcepts](http://williamsconcepts.com/ci/codeigniter/libraries/template/)或[phil's](https://github.com/philsturgeon/codeigniter-template)或[另一个](http:// www.google.com/search?q=codeigniter+template)? – swatkins

回答

0

Template Library for CodeIgniter用于写入

$this->template->set_regions($regions); 

动态添加区当前设置的模板

$this->template->add_regions($name, $props); 

空区域”

区域集S含量

$this->template->empty_region($name);