Welcome Guest, Not a member yet? Register   Sign In
Store view in variable/views within views
#1

[eluser]Lockzi[/eluser]
Hello, I'm wondering if something like this would be possible:

Code:
$data['content'] = $this->load->view('skeleton/main_view', $data);

and then in the view go like

Code:
<?=$content?>


This would be extremely useful for ajax update requests because then I can call a function in my controller to just render the information that should change.

Cheers
#2

[eluser]Seppo[/eluser]
I'm not sure if it's what you want, but if the third parameter is true the view is returned and not printed

Code:
$data['content'] = $this->load->view('skeleton/main_view', $data, TRUE);
#3

[eluser]Lockzi[/eluser]
Thanks for clearifying that I'm an idiot...

Kidding Smile


You are my hero, honestly! Atleast for tonight hahahahaaaaa This was exactly what I was looking for.
#4

[eluser]Ziggomat1k[/eluser]
Thanks for this!




Theme © iAndrew 2016 - Forum software by © MyBB