Can I have data['miVariable'] available in all methods in class? - 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: Can I have data['miVariable'] available in all methods in class? (/showthread.php?tid=30648) |
Can I have data['miVariable'] available in all methods in class? - El Forum - 05-21-2010 [eluser]chefnelone[/eluser] Hello Can I have data['miVariable'] available in all methods in class? Let say I have the index class, how can I make data['miVariable'] reachable for all the methods in the class. I tried putting it in the construct function but nope... Code: class Index extends MY_Controller { Can I have data['miVariable'] available in all methods in class? - El Forum - 05-21-2010 [eluser]danmontgomery[/eluser] http://www.php.net/manual/en/language.oop5.basic.php Code: class Index extends MY_Controller { Can I have data['miVariable'] available in all methods in class? - El Forum - 05-21-2010 [eluser]chefnelone[/eluser] Thanks noctrum. I really need to go into a OOP tutorial/book. Can I have data['miVariable'] available in all methods in class? - El Forum - 05-21-2010 [eluser]tomcode[/eluser] You can also load the data in the constructor Code: class Index extends MY_Controller { |