• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multible views, one Template - wont work ? :/

#1
[eluser]Thomas Fuston[/eluser]
Aloha !

i know maybe this is just a annoying "beginner question" but, i try to get 1 main_template and within this template some others will be loaded.

example:
Code:
$template['head'] = $this->load->view('main_head');

$this->load->view('main_template',$template);

isn't this possible to work ?

It seems codeigniter not loading the head view, into "$template" , it just load it, like a normal view call.

so it loading it like i would write
Code:
$this->load->view('main_head');
$this->load->view('main_template');

anyone got an idea ?
so far^^lemontree

p.s. sry for my bad english Smile

#2
[eluser]rogierb[/eluser]
I suggest you read the user guide =>"Returning views as data" in the views part

You only need to add TRUE.
Code:
$template['head'] = $this->load->view('main_head','',true);

#3
[eluser]Thomas Fuston[/eluser]
Ok it worked,

ahrg, sry for just a question, which could be answered by myself.
if i reading right..

finaly had to write
Code:
$template['head'] = $this->load->view('main_head', '', true);

thx so far ^^


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.