Welcome Guest, Not a member yet? Register   Sign In
Accessing a User Object From a Parent Controller
#2

[eluser]jonez[/eluser]
Code:
<?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');
class Dashboard extends Admin_Controller
{
    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {
        if ($this->data[ 'user_data' ]->role_id == 2)
        {
            $dashboard = 'admin_dashboard';
        }
        else
        {
            $dashboard = 'user_dashboard';
        }
        $this -> template -> build('admin/'.$dashboard, $this -> data);
    }
}


Messages In This Thread
Accessing a User Object From a Parent Controller - by El Forum - 02-02-2014, 11:35 AM
Accessing a User Object From a Parent Controller - by El Forum - 02-02-2014, 11:58 AM
Accessing a User Object From a Parent Controller - by El Forum - 02-02-2014, 12:01 PM
Accessing a User Object From a Parent Controller - by El Forum - 02-02-2014, 12:07 PM
Accessing a User Object From a Parent Controller - by El Forum - 02-02-2014, 12:11 PM
Accessing a User Object From a Parent Controller - by El Forum - 02-02-2014, 12:22 PM



Theme © iAndrew 2016 - Forum software by © MyBB