CodeIgniter Forums
Can Views be forced to be sent? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Can Views be forced to be sent? (/thread-53816.html)



Can Views be forced to be sent? - El Forum - 08-10-2012

[eluser]micha8l[/eluser]
Is there a method or something to call for views to be rendered on call. I mean besides doing return $this->load->view('my_view');

I'd like to use such a method from within my library http://ellislab.com/forums/viewthread/212800/


Can Views be forced to be sent? - El Forum - 08-10-2012

[eluser]LuckyFella73[/eluser]
Did you try this:

Code:
$this->load->view('myfile', '', false);

setting a third parameter to "false" should output the view directly
according to the user guide.


Can Views be forced to be sent? - El Forum - 08-10-2012

[eluser]TWP Marketing[/eluser]
[quote author="micha8l" date="1344589985"]
...
I mean besides doing return $this->load->view('my_view');
...
[/quote]

Don't use return
Just using
Code:
$this->load->view('my_view');
is sufficient.
By default CI will render the view to the browser.