How can I get the current model name in AppModel?
I have this code to verify password and confirm password. But I would like to put it in AppModelp:
function isSameAs($check, $field) {
if( $check === $this->data['User'][$field] ) {
return true;
}
else {
return false;
}
}
I am using CakePHP 2.
You are best to use
$this->alias(see API for model). Using @Ben Lee’s suggestion, that would be: