本文整理汇总了PHP中yii\rest\ActiveController::verbs方法的典型用法代码示例。如果您正苦于以下问题:PHP ActiveController::verbs方法的具体用法?PHP ActiveController::verbs怎么用?PHP ActiveController::verbs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\rest\ActiveController
的用法示例。
在下文中一共展示了ActiveController::verbs方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: verbs
/**
* @inheritdoc
*/
protected function verbs()
{
$verbs = parent::verbs();
$verbs['edit'] = ['POST'];
$verbs['detail'] = ['GET'];
$verbs['update'] = ['PUT'];
$verbs['restore'] = ['PATCH'];
return $verbs;
}
示例2: verbs
protected function verbs()
{
$verbs = parent::verbs();
/*
* We want to override the default verbs, because otherwise OPTIONS don't work.
* Somehow the Yii2 documentation didn't describe reality.
* This fixes one of those issues.
*/
$verbs['options'] = ['OPTIONS'];
return $verbs;
}
示例3: verbs
/**
* @inheritdoc
*/
public function verbs()
{
return parent::verbs() + ['update-collection' => ['PATCH']];
}
示例4: verbs
/**
* @inheritdoc
*/
protected function verbs()
{
$verbs = parent::verbs();
$verbs['update'] = ['POST'];
return $verbs;
}
示例5: verbs
/**
* @inheritdoc
*/
protected function verbs()
{
$verbs = array_merge(parent::verbs(), ['save' => ['POST'], 'batch-save' => ['POST']]);
//Override 'delete' verbs
$verbs['delete'] = ['GET', 'DELETE'];
return $verbs;
}
示例6: verbs
protected function verbs()
{
$verbs = parent::verbs();
$verbs['roles'] = ['GET', 'HEAD'];
return $verbs;
}
示例7: verbs
/**
* @inheritdoc
*/
protected function verbs()
{
return \yii\helpers\ArrayHelper::merge(parent::verbs(), ['index' => ['GET', 'HEAD'], 'view' => ['GET', 'HEAD'], 'create' => ['GET', 'POST', 'PUT', 'PATCH'], 'update' => ['GET', 'POST', 'PUT', 'PATCH'], 'delete' => ['GET', 'POST', 'DELETE']]);
}
示例8: verbs
public function verbs()
{
return parent::verbs();
}