![]() |
$this->load->view() and $this->parser->parse() can't permit two calls in the same run - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: $this->load->view() and $this->parser->parse() can't permit two calls in the same run (/showthread.php?tid=4585) |
$this->load->view() and $this->parser->parse() can't permit two calls in the same run - El Forum - 12-04-2007 [eluser]Unknown[/eluser] It is, if you call: $this->load->view() and you recall this function in the same execution, only outputs the last call. First call is loosed. Already not is possible store output in a variable, this appear empty. I tried in the solution of call diferents "output" procedures, like: $this->parser->parse() If i call this function two times, fail, and only return the last call. In this case, i have two methods to parse templates in a same execution, but i need three or more (header, body, footer). How I can to parse three or more templates in the same execution? Example: Code: function ParsePage() Tanks $this->load->view() and $this->parser->parse() can't permit two calls in the same run - El Forum - 12-04-2007 [eluser]tonanbarbarian[/eluser] If you want to get the result of the view in a variable then you need to set the 3rd parameter to true i.e. Code: function ParsePage() just of note in case you are not aware the 2nd parameter is the data to send to the view. I am setting to null in this example because I do not know if you have any data to send $this->load->view() and $this->parser->parse() can't permit two calls in the same run - El Forum - 12-04-2007 [eluser]ejangi[/eluser] You should also be able to do this (according to the documentation): Code: function ParsePage() $this->load->view() and $this->parser->parse() can't permit two calls in the same run - El Forum - 12-05-2007 [eluser]Unknown[/eluser] [quote author="tonanbarbarian" date="1196822891"]If you want to get the result of the view in a variable then you need to set the 3rd parameter to true i.e. Code: function ParsePage() just of note in case you are not aware the 2nd parameter is the data to send to the view. I am setting to null in this example because I do not know if you have any data to send[/quote] Tankyou tonanbarbarian. You solved my problem. It's very easy ![]() |