如何覆蓋模塊的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