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

[eluser]dmyers[/eluser]
[quote author="thinkigniter" date="1229327511"]
Code:
$this->bol = $this->auth->checkaccess();
refers to a variable $bol which, as before, is set right after you create the class e.g.
Code:
class Auth extends Model {
  var $_auth = '';
Is this variable set?[/quote]


Did I do this right? I declared the variable line 2 var $_auth = ''; and then set it to true on this line $this->_auth = true;

Did I do that right?

class Auth extends Model {
var $_auth = '';

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

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


then in MY_Controller I load the class/object with this $this->load->model('auth'); and then call the newly loaded/created object with this? $this->bol = $this->auth->checkaccess();

class MY_Controller extends Controller {
var $bol = null;

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

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

}

Did I do everything right?

Don ---


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