![]() |
variable from input to view - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: variable from input to view (/showthread.php?tid=61805) |
variable from input to view - Dizner - 05-19-2015 Hi guys! I am new in CodeIgniter and I have one probably simple question. I tried google it but I couldn't found right answer or I just didn't new how to usi it in my code. So, what I want is that from prisijungus.php (this is from my native language) form_input set variable that I could use in other view file. This is my view file prisijungus.php: PHP Code: <?php In other view file I will just echo variable. I hope you understand what I want, sorry for bad english and thanks for reply's! RE: variable from input to view - InsiteFX - 05-19-2015 There are several ways of doing this. 1) Use a session variable. 2) CI way: Makes them global to all views. PHP Code: $data['your_variable'] = 'your_variable'; 3) Find a good Registry Class and store them in it. RE: variable from input to view - madaan_tushar - 05-22-2015 You can't use it like this way, you have to make that variable "GLOBAl". Please browse the net to make variable in CI. I give a hint, that it will be done in the MY_Controller.php file,I hope you extend the CI_Controller in the core folder. |