How can I include or Call Session Controller In to My home page ,about page .... |
How Can I Include or call the my session controller file .. in to my home page .. due to session check .... ?
in php : include(session_check.php); in CI :.......?
Manikanta
(05-08-2015, 02:38 AM)Chandini Wrote: How Can I Include or call the my session controller file .. in to my home page .. due to session check .... ? I think you are confusing Controllers, Models and Libraries (in your attached images, you write a model in a controller then load it as a `Library`!) I suggest you read the User Guide first: http://www.codeigniter.com/user_guide/
If you want to write you session check as a library, you need to put your Session_check file into the library folder:
app ----library --------Session_check.php You can load it via $this->load->library('Session_check'); , if the file is called Session_check.php. But you can't simply extends CI_Controller, you need to get an instance of CI, via get_instance(); Have a look here, if you don't know how to get CI instance. ![]() http://forum.codeigniter.com/thread-61626.html And for the purpose of learning, look here http://www.codeigniter.com/userguide3/ge...aries.html But for simpleness, just write the Content of Session_check in the same controller or write it in a MY_Controller and extend it, instead of CI_Controller. But this is just a mention. ![]() -.-.-.-.-.-.-.-.-
![]() |
Welcome Guest, Not a member yet? Register Sign In |