This commit is contained in:
Kavalar 2024-05-26 12:52:52 +03:00
parent df93c25693
commit 6812f2333e
5 changed files with 116 additions and 67 deletions

View File

@ -24,18 +24,30 @@ class AddressesController extends Controller
}
/**
* {@inheritdoc}
* @inheritDoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
return array_merge(
parent::behaviors(),
[
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
],
];
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
]
);
}
/**

View File

@ -14,19 +14,32 @@ use yii\filters\VerbFilter;
*/
class CheckController extends Controller
{
/**
* {@inheritdoc}
* @inheritDoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
return array_merge(
parent::behaviors(),
[
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
],
];
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
]
);
}
/**

View File

@ -26,44 +26,44 @@ class CompanyController extends Controller
/**
* {@inheritdoc}
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
];
}
// public function behaviors()
// {
// return [
// 'verbs' => [
// 'class' => VerbFilter::className(),
// 'actions' => [
// 'delete' => ['POST'],
// ],
// ],
// ];
// }
/**
* @inheritDoc
*/
// public function behaviors()
// {
// return array_merge(
// parent::behaviors(),
// [
// 'verbs' => [
// 'class' => VerbFilter::className(),
// 'actions' => [
// 'delete' => ['POST'],
// ],
// ],
// 'access' => [
// 'class' => \yii\filters\AccessControl::className(),
// 'rules' => [
// [
// 'allow' => true,
// 'roles' => ['@'],
// ],
// ],
// ],
// ]
// );
// }
public function behaviors()
{
return array_merge(
parent::behaviors(),
[
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
]
);
}
/**
* Lists all Company models.
@ -108,7 +108,7 @@ class CompanyController extends Controller
if ($model->load($this->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
Debug::prn($model);
Debug::prn($model->errors);
} else {
$model->loadDefaultValues();
}

View File

@ -24,18 +24,30 @@ class ProductController extends Controller
}
/**
* {@inheritdoc}
* @inheritDoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
return array_merge(
parent::behaviors(),
[
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
],
];
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
]
);
}
/**

View File

@ -27,18 +27,30 @@ class ProductCategoryController extends Controller
}
/**
* {@inheritdoc}
* @inheritDoc
*/
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
return array_merge(
parent::behaviors(),
[
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['POST'],
],
],
],
];
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
]
);
}
/**