![]() |
variables in views - 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: variables in views (/showthread.php?tid=59060) |
variables in views - El Forum - 08-19-2013 [eluser]Unknown[/eluser] Hello, i didnt understand the folowing, can someone help me? If i have 2 views and i give a data array to the first, in the second i can use these variables too Example: Code: $data['example'] = 'value'; Is this normal (i think it shouldnt)? If yes, why? Is there a config-possibility to chance this behavior, so the variables didnt pass? Thank you very much in advance for your answer! (I use CodeIgniter 2.1.4) variables in views - El Forum - 08-22-2013 [eluser]LuckyFella73[/eluser] Hej Anna, yes that is the way the CI views work. There was a thread a while ago where the reasons where explained - I can't remember .. There are no config settings to supress that behaviour as far as I know. I guess all you can do is Code: $data['example'] = 'value blah 1'; variables in views - El Forum - 08-22-2013 [eluser]Unknown[/eluser] Hello Lucky, thank you for your answer! Your proposal will do it for the Moment ... but if the name of the variable is variable it doesnt work. Ich thaught that i perhabs can extend the Loader Class, to flash the data ... but i dont know if it is possible!? |