The class of the ActiveRecord should be specified via [[modelClass]], which must implement ActiveRecordInterface. By default, the following actions are supported: - index: list of models - view: the details of a model - create: create a new model - update: update an existing model - delete: delete an existing model You may disable some of these actions by overriding CrudController::actions and unsetting the corresponding actions.
С версии: 1.0
Автор: Paul Klimov (klimov.paul@gmail.com)
Наследование: extends yii\web\Controller
 /**
  * @inheritdoc
  */
 public function actions()
 {
     $actions = parent::actions();
     unset($actions['create']);
     unset($actions['update']);
     return $actions;
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     return ArrayHelper::merge(parent::actions(), ['delete' => ['class' => 'yii2tech\\admin\\actions\\SafeDelete'], 'restore' => ['class' => 'yii2tech\\admin\\actions\\Restore'], 'suspend' => ['class' => 'yii2tech\\admin\\actions\\Callback', 'callback' => 'suspend'], 'activate' => ['class' => 'yii2tech\\admin\\actions\\Callback', 'callback' => 'activate']]);
 }
Пример #3
0
 /**
  * @inheritdoc
  */
 public function actions()
 {
     $actions = parent::actions();
     unset($actions['create']);
     return ArrayHelper::merge($actions, ['suspend' => ['class' => 'yii2tech\\admin\\actions\\Callback', 'callback' => 'suspend'], 'activate' => ['class' => 'yii2tech\\admin\\actions\\Callback', 'callback' => 'activate']]);
 }