HMVC | Undefined property: $session | $this->session is null |
[eluser]oukarai[/eluser]
hi i got this erro message: A PHP Error was encountered Severity: Notice Message: Undefined property: Login::$session Filename: controllers/login.php and my login control is login.php class Login extends CI_Controller { function is_logged_in() { $is_logged_in = $this->session->userdata('is_logged_in'); //<=here if(!isset($is_logged_in) || $is_logged_in != true) { echo 'You don\'t have permission to access this page.'; die(); } } } and my site control is class Site extends CI_Controller { function __construct() { parent::__construct(); modules::run('login/is_logged_in'); } function members_area() { $this->load->view('logged_in_area'); } } while its only one part of the source i access http://localhost/hmvcExample/index.php/s...mbers_area the error message is showed i haved autoload libraries session help!!!
[eluser]InsiteFX[/eluser]
Did you load the Session Class in autoload.php or your controller? Also next time please use code tags to wrap your code! InsiteFX
[eluser]InsiteFX[/eluser]
And where are you setting the session variable? InsiteFX
[eluser]oukarai[/eluser]
in my login.php's validate_credentials action Code: function validate_credentials()
[eluser]oukarai[/eluser]
by the way im studying the hmvc right now according HMVC: an Introduction and Application the source all come from the site above
[eluser]InsiteFX[/eluser]
And where is this validate_credentials method located? InsiteFX
[eluser]oukarai[/eluser]
when i put in the url http://localhost/hmvcExample/index.php/login/ the login form is showed and i put in my id and pass then put the login button the validate_credentials method is located
[eluser]InsiteFX[/eluser]
Did you download the newest HMVC from the CodeIgniter WIKI? That Example is for the older CodeIgniter v1.7.3 CodeIgniter 2.0.+ uses PHP 5+ so you need the new HMVC for it to work. InsiteFX
[eluser]oukarai[/eluser]
yes i did That Example is for the older CodeIgniter v1.7.3 but i didnt find the codeigniter-modular-extensions-hmvc 5.2 so i go to Modular Extensions - HMVC the site above and got the most newest hmvc file by the way , i use ci 2.0.1 now and php 5.3 |
Welcome Guest, Not a member yet? Register Sign In |