• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I include or Call Session Controller In to My home page ,about page ....

#1
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   :.......?  


Attached Files Thumbnail(s)
       
Manikanta
Reply

#2
(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 .... ?

in php : include(session_check.php);

in CI   :.......?  

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/
Reply

#3
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. Wink
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. Tongue
-.-.-.-.-.-.-.-.- Angel -.-.-.-.-.-.-.-.-
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.