[eluser]Coder Death[/eluser]
Hello to all,
How can I send dynamic data to my default template ?
this is the part of the template file
Code:
$template['default']['regions'] = array(
'header' => array(
'content' => array('
<div class="menu_list_home">
Menu_1
Menu_2
Menu_3
Menu_4
</div>
'),
'content' => array(
'content' => array(
'<div id="content_left">
'.@$left_content.'
</div>
<div id="content_right" class="box-register_2">
<font class="text_head">Registration form</font><br />
</div>',
)
),
'footer' => ...
);
This code works without problem when I load the website, it loads as default page.
This is my view file
Code:
<body class="dashboard">
<div class="wrapper">
<?= $header ?>
<div id="content_">
<?= $content ?>
</div>
<div id="footer">
<?= $footer ?>
</div>
</div>
</body>
My problem is that I would like to load the same template with the same view when I click on any of the menu <i>Menu_1 ... Menu_4</i>
For this I create view files <i>menu_1.php </i> for example.
and in the controller I create a public function
Code:
public function menu_1 () {
$data['left_content'] = 'Hello this is the menu_1';
$data_=$this->load->view('menu_1',$data);
$this->template->render();
}
has been placed in the template in the area where I want Menu_1 to be displayed.
Unfortunately, the page is loading the default one without displaying in the content area.
How can I solve this ?
Thanks