Implementing a new library - moving data between controller and view. - 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: Implementing a new library - moving data between controller and view. (/showthread.php?tid=21483) |
Implementing a new library - moving data between controller and view. - El Forum - 08-11-2009 [eluser]Unknown[/eluser] I believe I have this question because I am weak in PHP OOP, a beginner in Codeigniter or a combination :-S I am having a problem understanding how to share an object between a view and controller. I am implementing a date/time form field class that works in plain old php/html. It uses pulldowns to set YMD and HH:MM fields, takes care of some conversions and parsing. In the view I have: Code: $concert_datetime = new Datetime_field(); Code: echo $concert_datetime->get_select_years("ldigit", "2009", "2012", "year"); Code: $justEnteredDateTime = $concert_datetime->get_timestamp_entered(); Do I need a different form of reference? Do I need to move the object declaration to the controller? Then how do I refer to it in the view? I would very much like to rtfm or rtft(utorial) or w(atch)tft but I have not yet found them :red: |