Welcome Guest, Not a member yet? Register   Sign In
How to load view into a library
#1

[eluser]Unknown[/eluser]
Hi there,
i am trying to load a view into a library that I am making.
I istanziate the:

$this->CI =& get_instance();

and i try to load a view with the syntax:
$this->CI->load->view('view_name');

there is something wrong? Cause i can't see the output.

Thanks in advance
#2

[eluser]JoostV[/eluser]
Not sure I understand correctly. Are you trying to fetch the view as a string?
Code:
$this->CI =& get_instance();
// third parameter true returns the view as string
$string = $this->CI->load->view('view_name', '', true);
#3

[eluser]Unknown[/eluser]
Woah...thanks...you have solved my problem!

Never know that you can return a view into a string format!

Thanks again!




Theme © iAndrew 2016 - Forum software by © MyBB