本文整理匯總了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();
}