![]() |
I can't to do works two functions at same times. - 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: I can't to do works two functions at same times. (/showthread.php?tid=55157) Pages:
1
2
|
I can't to do works two functions at same times. - El Forum - 10-12-2012 [eluser]masentinel900[/eluser] I need declare some functions with different variables, these variables will content information fetched of the appropiate model across your controller. The problem start in the moment that I need call the variables in the view file, By default only show me the variables that is declared in the index function, and the another show a error "indefined variable" And if I call the function across of URL don't works the first "index", Just works I called in the URL. Please some that can help me... I can't to do works two functions at same times. - El Forum - 10-12-2012 [eluser]vitoco[/eluser] Maybe it's just me, but i didn't understand your explanation, please post some code or an example. Slds I can't to do works two functions at same times. - El Forum - 10-12-2012 [eluser]tpetrone[/eluser] so I think your asking is how to return data from two different models from within the same controller, then load the data into the view. Code: $data1 = $this->your_model->get_some_data(); I can't to do works two functions at same times. - El Forum - 10-12-2012 [eluser]skunkbad[/eluser] [quote author="vitoco" date="1350060021"]Maybe it's just me, but i didn't understand your explanation, please post some code or an example. Slds[/quote] +1 I can't to do works two functions at same times. - El Forum - 10-13-2012 [eluser]masentinel900[/eluser] Ok, I´m sorry if I don´t explain me of the better way. Here I put a single example, The mine is a bit most hard. If I need to make a page with Header, Body and Footer; And the controller will look like this: Controller Code: function header() So In the page file in the VIEWS I call that variables simply adding a php script with "echo $footer", "echo $header" and "echo $body". My problem start when I try of add the three variables same time, I need use them in the same page. I thought that were problem of Index.php and I´ve been trying of remove it but I don´t get it.. Many thanks to the people that interest in this post.. I can't to do works two functions at same times. - El Forum - 10-13-2012 [eluser]skunkbad[/eluser] Code: // Controller method I can't to do works two functions at same times. - El Forum - 10-13-2012 [eluser]masentinel900[/eluser] Thanks "Skunkbad", Do you have the reason. But I need to make each one functions with content brought of a functions of a model. So. Model Code: class user extends CI_Model I use the function login for to make a loggin acces to my website and works perfect, But now I need brought information of different tables of my DB. Is by this that I need make several functions with different information. Now I need to get this content of differents tables, pass to my controller for to define some rules and finally may show it in my view page. I can't to do works two functions at same times. - El Forum - 10-13-2012 [eluser]skunkbad[/eluser] Yeah, because it works Code: // Controller method I can't to do works two functions at same times. - El Forum - 10-13-2012 [eluser]masentinel900[/eluser] Sir skunkbad Again I give you very thanks. Is very important for me can fix it. I going to test this solution that you proposed me. I Would like to know if is possible to do works more than one function in the controller file.. I can't to do works two functions at same times. - El Forum - 10-13-2012 [eluser]skunkbad[/eluser] [quote author="masentinel900" date="1350147407"]Sir skunkbad Again I give you very thanks. Is very important for me can fix it. I going to test this solution that you proposed me. I Would like to know if is possible to do works more than one function in the controller file.. [/quote] Yes, you can have more than one function in a controller, but codeigniter considers them to be routes unless they are protected or private. |