public function actions() { $actions = parent::actions(); // disable the "delete" and "create" actions unset($actions['delete'], $actions['create']); return $actions; }
/** * Override the base actions in order to support some enhancements of actions * by default for all active controllers. * @see \yii\rest\ActiveController::actions() */ public function actions() { $actions = parent::actions(); $actions['index']['class'] = '\\luya\\rest\\actions\\IndexAction'; $actions['delete']['class'] = '\\luya\\rest\\actions\\DeleteAction'; return $actions; }
public function actions() { $actions = parent::actions(); unset($actions['view']); $actions1 = ArrayHelper::merge(['actionPedido'], $actions); return $actions1; }
public function actions() { $actions = parent::actions(); // customize the data provider preparation with the "prepareDataProvider()" method $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; return $actions; }
public function actions() { $actions = parent::actions(); $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; //$actions['create']['run'] = [$this, 'run1']; return $actions; }
public function actions() { $actions = parent::actions(); // personalizza il data provider preparation con il metodo "prepareDataProvider()" $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; return $actions; }
/** * @inheritdoc */ public function actions() { $actions = parent::actions(); unset($actions['index']); unset($actions['create']); return $actions; }
public function actions() { $actions = parent::actions(); unset($actions['index'], $actions['update'], $actions['create'], $actions['delete'], $actions['view']); //unset($actions['update'], $actions['create'], $actions['delete'], $actions['view']); return $actions; }
public function actions() { $actions = parent::actions(); // remove parent's control over create unset($actions['create']); return $actions; }
/** * 定义actions * @return array */ public function actions() { $actions = parent::actions(); //unset($actions['create']) ; //设置index操作的dataProvider $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; return $actions; }
/** * Переобределяем свои действия * @return array */ public function actions() { $actions = parent::actions(); unset($actions['index']); //unset($actions['update']); $this->model = new $this->modelClass(); return $actions; }
public function actions() { $actions = parent::actions(); // change index class $actions['index']['class'] = '\\admin\\rest\\IndexAction'; $actions['delete']['class'] = '\\admin\\rest\\DeleteAction'; return $actions; }
public function actions() { $actions = parent::actions(); // customize the data provider preparation with the "prepareDataProvider()" method $actions['index']['prepareDataProvider'] = [$this, 'actionIndex']; $actions['view']['findModel'] = [$this, 'actionView']; $actions['delete']['findModel'] = [$this, 'actionDelete']; return $actions; }
public function actions(){ $actions = parent::actions(); unset($actions['index']); unset($actions['update']); unset($actions['create']); unset($actions['delete']); // $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; return $actions; }
public function actions() { $actions = parent::actions(); // disable the "delete" and "create" actions unset($actions['delete'], $actions['create'], $actions['get'], $actions['post']); // customize the data provider preparation with the "prepareDataProvider()" method $actions['index']['prepareDataProvider'] = array($this, 'prepareDataProvider'); return $actions; }
public function actions() { return array_merge(parent::actions(), ['index' => ['class' => 'yii\\rest\\IndexAction', 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess'], 'prepareDataProvider' => function ($action) { $m = new InputParamsSearch(); $params = \Yii::$app->getRequest()->getQueryParams(); $dataProvider = $m->search($params); return $dataProvider; }], 'create' => ['class' => 'api\\components\\rest\\InputParamsCreateAction', 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess']]]); }
public function actions() { $actions = parent::actions(); // Only allow read-only actions (for now) unset($actions['delete'], $actions['update'], $actions['create']); //customize the data provider preparation with the "prepareDataProvider()" method $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; return $actions; }
public function actions() { $actions = parent::actions(); // disable the "delete" and "create" actions //unset($actions['view'], $actions['create']); // customize the data provider preparation with the "prepareDataProvider()" method //$actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; return $actions; }
/** * @inheritdoc */ public function actions() { $actions = parent::actions(); $actions['index']['prepareDataProvider'] = [$this, 'prepareListDataProvider']; $actions['edit'] = ['class' => Postman\backend\controllers\rest\TemplateController\EditFormAction::class, 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess']]; $actions['detail'] = ['class' => Postman\backend\controllers\rest\TemplateController\DetailAction::class, 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess']]; $actions['delete'] = ['class' => \cookyii\rest\actions\DeleteAction::class, 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess']]; $actions['restore'] = ['class' => \cookyii\rest\actions\RestoreAction::class, 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess']]; return $actions; }
/** * Specify the defatult actions for restful web service * */ public function actions() { $actions = parent::actions(); $actions['index']['class'] = 'backend\\components\\rest\\IndexAction'; $actions['create']['class'] = 'backend\\components\\rest\\CreateAction'; $actions['update']['class'] = 'backend\\components\\rest\\UpdateAction'; $actions['delete']['class'] = 'backend\\components\\rest\\DeleteAction'; $actions['view']['class'] = 'backend\\components\\rest\\ViewAction'; return $actions; }
public function actions() { return array_merge(parent::actions(), ['index' => ['class' => 'yii\\rest\\IndexAction', 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess'], 'prepareDataProvider' => function ($action) { $model = new $this->modelClass(); $query = $model::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $model->setAttribute('title', @$_GET['title']); $query->andFilterWhere(['like', 'title', $model->title]); return $dataProvider; }]]); }
public function actions() { $actions = parent::actions(); // disable the "delete" and "create" actions unset($actions['delete'], $actions['create']); // customize the data provider preparation with the "prepareDataProvider()" method $actions['index']['prepareDataProvider'] = [$this, 'prepareIndexDataProvider']; $actions['view']['findModel'] = [$this, 'findSampleView']; // different mechanism, no prepareDataProvider return $actions; }
public function actions() { return array_merge(parent::actions(), ['index' => ['class' => 'yii\\rest\\IndexAction', 'modelClass' => $this->modelClass, 'checkAccess' => [$this, 'checkAccess'], 'prepareDataProvider' => function ($action) { /* @var $model Car */ $model = new $this->modelClass(); $query = $model::find(); $query->where('user_id = ' . (int) Yii::$app->user->id); $dataProvider = new ActiveDataProvider(['query' => $query]); return $dataProvider; }]]); }
public function actions() { $actions = parent::actions(); // customize the data provider preparation with the "prepareDataProvider()" method $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; $actions['view']['checkAccess'] = [$this, 'checkAccess']; $actions['update']['checkAccess'] = [$this, 'checkAccess']; $actions['create']['checkAccess'] = [$this, 'checkAccess']; $actions['delete']['checkAccess'] = [$this, 'checkAccess']; return $actions; }
public function actions() { $actions = parent::actions(); $actions['index']['prepareDataProvider'] = function () { // Get id param $request = \Yii::$app->getRequest(); $id = $request->get('id'); $query = FormRule::find()->where('form_id=:form_id', [':form_id' => $id]); return new ActiveDataProvider(['query' => $query]); }; return $actions; }
public function actions() { $actions = parent::actions(); // disable the "delete" and "create" actions //unset($actions['patch'], $actions['create']); //$actions = parent::actions(); //unset($actions['index']); // customize the data provider preparation with the "prepareDataProvider()" method $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; //$actions['index']['prepareDataProvider'] = [new Articulos(), 'listadoPorUbicacion(50, 18.4800978, -69.8804773)']; return $actions; }
/** * @return array */ public function actions() { $actions = parent::actions(); $actions['index']['modelClass'] = 'app\\models\\Stats'; $actions['index']['prepareDataProvider'] = function () { $page = Yii::$app->request->get('page', 1) - 1; $pageSize = Yii::$app->request->get('per-page', 10); return new ArrayDataProvider(['allModels' => Stats::findAll($pageSize, $page * $pageSize, $total), 'totalCount' => $total, 'pagination' => ['pageSize' => $pageSize]]); }; $actions['create']['modelClass'] = 'app\\models\\Stats'; $actions['view']['modelClass'] = 'app\\models\\Stats'; return $actions; }
public function actions() { $actions = parent::actions(); $actions['index']['class'] = '\\app\\controllers\\base\\IndexAction'; $actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider']; $actions['view']['class'] = '\\app\\controllers\\base\\ViewAction'; $actions['create']['class'] = '\\app\\controllers\\base\\CreateAction'; $actions['update']['class'] = '\\app\\controllers\\base\\UpdateAction'; $actions['delete']['class'] = '\\app\\controllers\\base\\DeleteAction'; $actions['options']['class'] = '\\app\\controllers\\base\\OptionsAction'; $actions['options']['verbs'] = $this->verbs(); $actions['options']['modelClass'] = $this->modelClass; return $actions; }
public function actions() { $actions = parent::actions(); $actions['index']['prepareDataProvider'] = function () { // Get id param $request = \Yii::$app->getRequest(); $id = $request->get('id'); $q = $request->get('q'); $query = FormSubmission::find()->where('form_id=:form_id', [':form_id' => $id]); if (isset($q)) { $query = FormSubmission::find()->where('form_id=:form_id', [':form_id' => $id])->andWhere(['like', 'data', $q]); } return new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => Yii::$app->params['GridView.pagination.pageSize']], 'sort' => ['defaultOrder' => ['id' => SORT_DESC]]]); }; return $actions; }
public function actions() { $actions = parent::actions(); return $actions; }