CodeIgniter Forums
is it possible? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: is it possible? (/showthread.php?tid=28226)



is it possible? - El Forum - 03-05-2010

[eluser]xeroblast[/eluser]
i am trying to load the result of the controller to another controller...

what i mean is like this...

Code:
$data['result'] = // the result of the controller here
$this->load->view('view_html',$data); // load the result to the view

the controller result is an html form

my last option is to create a helper the can load the html form...

any bright ideas...


is it possible? - El Forum - 03-05-2010

[eluser]Phil Sturgeon[/eluser]
You shouldn't be trying to load a controller directly. If the form is HTML why not load a view and assign it to that variable?


is it possible? - El Forum - 03-05-2010

[eluser]xeroblast[/eluser]
so you are saying i could do it like this:

Code:
$data['result'] = $this->load->view('loaded_html');
$this->load->view('view_html',$data);



is it possible? - El Forum - 03-05-2010

[eluser]Phil Sturgeon[/eluser]
[code]$data['result'] = $this->load->view('loaded_html', NULL, TRUE);
$this->load->view('view_html',$data);

The NULL is instead of the usual $data variable, and TRUE means "return the output instead of sending it to the browser".


is it possible? - El Forum - 03-05-2010

[eluser]Pintossauro[/eluser]
I think that you have to do:
Code:
$string = $this->load->view('myfile', '', true);



is it possible? - El Forum - 03-05-2010

[eluser]xeroblast[/eluser]
ok.. thanx.. that is what i needed...