本文整理汇总了PHP中yii\rest\ActiveController::actions方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveController::actions方法的具体用法?PHP ActiveController::actions怎么用?PHP ActiveController::actions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\rest\ActiveController
的用法示例。
在下文中一共展示了ActiveController::actions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actions
public function actions()
{
$actions = parent::actions();
// disable the "delete" and "create" actions
unset($actions['delete'], $actions['create']);
return $actions;
}
示例2: 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;
}
示例3: actions
public function actions()
{
$actions = parent::actions();
unset($actions['view']);
$actions1 = ArrayHelper::merge(['actionPedido'], $actions);
return $actions1;
}
示例4: actions
public function actions()
{
$actions = parent::actions();
// customize the data provider preparation with the "prepareDataProvider()" method
$actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider'];
return $actions;
}
示例5: actions
/**
* @inheritdoc
*/
public function actions()
{
$actions = parent::actions();
unset($actions['index']);
unset($actions['create']);
return $actions;
}
示例6: 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;
}
示例7: actions
public function actions()
{
$actions = parent::actions();
// remove parent's control over create
unset($actions['create']);
return $actions;
}
示例8: actions
/**
* 定义actions
* @return array
*/
public function actions()
{
$actions = parent::actions();
//unset($actions['create']) ;
//设置index操作的dataProvider
$actions['index']['prepareDataProvider'] = [$this, 'prepareDataProvider'];
return $actions;
}
示例9: actions
/**
* Переобределяем свои действия
* @return array
*/
public function actions()
{
$actions = parent::actions();
unset($actions['index']);
//unset($actions['update']);
$this->model = new $this->modelClass();
return $actions;
}
示例10: actions
public function actions()
{
$actions = parent::actions();
// change index class
$actions['index']['class'] = '\\admin\\rest\\IndexAction';
$actions['delete']['class'] = '\\admin\\rest\\DeleteAction';
return $actions;
}
示例11: 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;
}
示例12: 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;
}
示例13: 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;
}
示例14: 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']]]);
}
示例15: actions
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;
}