Welcome Guest, Not a member yet? Register   Sign In
Wick Problem
#1

[eluser]dmyers[/eluser]
I decided to test WICK so I could add it to my bag of tricks but, the first test worked fine but, when I added it to my "generic" test application which has it's own controller (MY_Controller of course) I got a Fatal error:

Fatal error: Call to a member function checkaccess() on a non-object in /Applications/MAMP/htdocs/codeigniter170/system/application/libraries/MY_Controller.php on line 8

MY_Controller contains

class MY_Controller extends Controller {

function MY_Controller() {
parent::Controller();

$this->load->model('auth');
$this->auth->checkaccess();
}

}

So I am loading the controller right before the call?

If I call the welcome.php controller (via browser) which extends MY_Controller everything is fine.

but when I call more.php controller (via browser) which extends MY_Controller I get the error

class More extends MY_Controller {

function More() {
parent::MY_Controller();
}

function index() {
$this->load->library('Wick');

$this->wick->light('welcome/index');

//$data = array('pagename'=>'More');
//$this->load->view('welcome_message',$data);
}
}

class Welcome extends MY_Controller {

function Welcome() {
parent::MY_Controller();
}

function index() {
$data = array('pagename'=>'Welcome');
$this->load->view('welcome_message',$data);
}
}


class More extends MY_Controller {

function More() {
parent::MY_Controller();
}

function index() {
$this->load->library('Wick');

$this->wick->light('welcome/index');

//$data = array('pagename'=>'More');
//$this->load->view('welcome_message',$data);
}
}

I get the error.

The Auth model is

class Auth Extends Model {
function Auth() {
parent::Model();
$this->_auth = true;
}

function checkaccess() {
if ($this->_auth) return;
}
}

which just returns because access is good (true in this case)

Don Myers


Messages In This Thread
Wick Problem - by El Forum - 12-14-2008, 04:11 PM
Wick Problem - by El Forum - 12-14-2008, 05:33 PM
Wick Problem - by El Forum - 12-14-2008, 07:02 PM
Wick Problem - by El Forum - 12-14-2008, 07:29 PM
Wick Problem - by El Forum - 12-14-2008, 07:42 PM
Wick Problem - by El Forum - 12-14-2008, 07:51 PM
Wick Problem - by El Forum - 12-14-2008, 08:12 PM
Wick Problem - by El Forum - 12-22-2008, 02:20 PM
Wick Problem - by El Forum - 12-22-2008, 03:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB