Welcome Guest, Not a member yet? Register   Sign In
MVC to HMVC error
#1

Hi guys, I've created simple registration and login forms connected with database on my computer (using WAMP). It worked fine with MVC, I could register, login, logout etc. Now I'm starting to work with HMVC, using CI 3.0 and proper version of HMVC extension. I've created two modules - 'site' and 'login'. This is a part of my site controller:

Code:
<?php

class Site extends CI_Controller
{
    function __construct()
    {
        parent::__construct();
        modules::run('login/is_logged_in');
    }

    function members_area()
    {
        $this->load->view('logged_in_area');
    }

and this is my is_logged_in function located in a login controller:


Code:
function is_logged_in()
    {
        $is_logged_in = $this->session->userdata('is_logged_in');
        if(!isset($is_logged_in) || $is_logged_in != true)
        {
            echo 'You don\'t have permission to access this page. <a href="../login">Login</a>';    
            die();        
        }        
    }

the problem is that when I Log-In, I get an error message "Unable to locate the specified class: Session.php". If I comment-out
Code:
modules::run('login/is_logged_in');
it works just fine but there is no check if I am logged-in (I can access members_area without logging-in).

If someone could help me somehow, I'd be very thankful  Cool
Reply


Messages In This Thread
MVC to HMVC error - by tomop - 06-09-2015, 02:22 PM
RE: MVC to HMVC error - by InsiteFX - 06-09-2015, 10:50 PM
RE: MVC to HMVC error - by tomop - 06-10-2015, 03:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB