如何覆盖模块的Yii登录URL模块?覆盖模块的Yii登录网址
这里是基本应用程序的主要配置:
return array(
.........
// application components
'components'=>array(
'user'=>array(
// enable cookie-based authentication
'allowAutoLogin'=>true,
'loginUrl' => '/site/login',
),
..........
);
后来才知道有代理模块,我想这在该模块中的登录网址是不同的登录方法也不同。
class AgentModule extends CWebModule {
public function init() {
// this method is called when the module is being created
// you may place code here to customize the module or the application
// import the module-level models and components
$this->setImport(array(
'agent.models.*',
'agent.components.*',
));
$this->defaultController = 'default';
$this->layoutPath = Yii::getPathOfAlias('agent.views.layout');
$this->components = array(
'user' => array(
'class' => 'AgentUserIdentity',
'loginUrl' => '/agent/default/login',
)
);
}
.......
但我不知道为什么这不起作用。 请帮忙...(T.T)
您要使用不同的用户应用程序组件的模块和应用程序?或者他们是一样的? – dInGd0nG
我想为模块使用不同的用户应用程序,例如:如果我在代理模块中,使用数据来自代理表的代理验证方法。 – GusDeCooL