Welcome Guest, Not a member yet? Register   Sign In
Templatefile
#1

[eluser]Fireclave[/eluser]
Hi, i am using a Templatefile:

Controller
Code:
function index()
   $data['site_load']  = 'adressbook/detail';
   $this->load->view('template', [b]$data[/b]);
}

Temlatefile

Code:
$this->load->view('includes/header');

if(isset($site_load))
    $this->load->view($site_load);
else  
    $this->load->view('user_panel/control');

$this->load->view('includes/footer');

But my Problem is, that the $data in my Controller will lost, because i send it to the template and not to the content page...

Do you have any idea ?

Possible is this in the Controller:

$d[$data];
$this->load->view('template', $data);

but i don't like this way.
#2

[eluser]InsiteFX[/eluser]
Give this a try:

Code:
function index() {
   $data['site_load']  = 'adressbook/detail';
   $this->load_vars($data);
   $this->load->view('template');
}

InsiteFX
#3

[eluser]Fireclave[/eluser]
$this->load_vars($data);

This is new ;-)
Thank you
#4

[eluser]InsiteFX[/eluser]
Your very welcome, take a look at the loader library!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB