コード例 #1
0
 /**
  * @inheritdoc
  */
 public function bootstrap($app)
 {
     if ($app instanceof \yii\web\Application) {
         $app->getUrlManager()->addRules([$this->id => $this->id . '/default/index', $this->id . '/<id:\\w+>' => $this->id . '/default/view', $this->id . '/<controller:[\\w\\-]+>/<action:[\\w\\-]+>' => $this->id . '/<controller>/<action>'], false);
     } elseif ($app instanceof \yii\console\Application) {
         $app->controllerMap[$this->id] = ['class' => Oauth2Controller::className()];
     }
 }
コード例 #2
0
ファイル: Module.php プロジェクト: karakum/yii2-oauth2-server
 /**
  * @inheritdoc
  */
 public function bootstrap($app)
 {
     if ($app instanceof \yii\console\Application) {
         $app->controllerMap[$this->id] = ['class' => Oauth2Controller::className()];
     }
 }