Пример #1
0
 /**
  * Initializes the module.
  *
  * This method is called after the module is created and initialized with property values
  * given in configuration. The default implementation will initialize [[controllerNamespace]]
  * if it is not set.
  *
  * If you override this method, please make sure you call the parent implementation.
  */
 public function init()
 {
     if ($this->userIdentityClass === null) {
         $this->userIdentityClass = Yii::$app->getUser()->identityClass;
     }
     if ($this->commentModelClass === null) {
         $this->commentModelClass = CommentModel::className();
     }
     parent::init();
 }
Пример #2
0
 /**
  * Declares external actions for the controller.
  *
  * @return array
  */
 public function actions()
 {
     return ['edit-comment' => ['class' => EditableAction::className(), 'modelClass' => CommentModel::className(), 'forceCreate' => false]];
 }