It allows to define allowed HTTP request methods for each action and will throw
an HTTP 405 error when the method is not allowed.
To use VerbFilter, declare it in the behaviors() method of your controller class.
For example, the following declarations will define a typical set of allowed
request methods for REST CRUD actions.
php
public function behaviors()
{
return [
'verbs' => [
'class' => \yii\filters\VerbFilter::className(),
'actions' => [
'index' => ['get'],
'view' => ['get'],
'create' => ['get', 'post'],
'update' => ['get', 'put', 'post'],
'delete' => ['post', 'delete'],
],
],
];
}