在 Cakephp 2 的自定义身份验证中使用用户模型
Use a user model in a custom authentification in Cakephp 2
我在蛋糕中使用自定义身份验证对象php。
In AppController :
$this->Auth->authenticate = array('Ldap','Database');
我需要我的自定义身份验证组件来连接到数据库。
我在 Controller/Component/Auth/DatabaseAuthentification.php 中创建了文件 DatabaseAuthenticate
在我的自定义对象中,我需要在我的数据库中请求 table。我已经尝试了一些比控制器更强大的功能
public $uses =array('Car', 'Bike');
但是没有用,不知道怎么办。
cakephp2?你可以试试:
$model = ClassRegistry::init('Yourmodel');
将模型简单查询到组件中
$result= $model->find('all');
我在蛋糕中使用自定义身份验证对象php。
In AppController :
$this->Auth->authenticate = array('Ldap','Database');
我需要我的自定义身份验证组件来连接到数据库。 我在 Controller/Component/Auth/DatabaseAuthentification.php 中创建了文件 DatabaseAuthenticate 在我的自定义对象中,我需要在我的数据库中请求 table。我已经尝试了一些比控制器更强大的功能
public $uses =array('Car', 'Bike');
但是没有用,不知道怎么办。
cakephp2?你可以试试:
$model = ClassRegistry::init('Yourmodel');
将模型简单查询到组件中
$result= $model->find('all');