access helper function inside controller - 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: access helper function inside controller (/showthread.php?tid=25490) |
access helper function inside controller - El Forum - 12-14-2009 [eluser]ranjitbd[/eluser] Code: // this is the controller method from where i called a function from helper file // Parse error: parse error in C:\xampp\htdocs\travelmartbd\system\helpers\common_function_helper.php on line 103 // what is wrong here... access helper function inside controller - El Forum - 12-14-2009 [eluser]ranjitbd[/eluser] [quote author="ranjitbd" date="1260807351"][code] // when i put the same method inside my customized library // it shows the following error in that same line number 103 // that line: $this->session->set_userdata($menu_data); Fatal error: Call to a member function set_userdata() on a non-object in C:\xampp\htdocs\travelmartbd\appl access helper function inside controller - El Forum - 12-14-2009 [eluser]rogierb[/eluser] $this-> (the CI superobject)does not exists in a helper or in a library. Read the user guide and you will understand why. A tip: you have to use get_instance() |