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() public function behaviors()
{ {
return [ return array_merge(
parent::behaviors(),
[
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
'actions' => [ 'actions' => [
'delete' => ['POST'], '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 class CheckController extends Controller
{ {
/** /**
* {@inheritdoc} * @inheritDoc
*/ */
public function behaviors() public function behaviors()
{ {
return [ return array_merge(
parent::behaviors(),
[
'verbs' => [ 'verbs' => [
'class' => VerbFilter::className(), 'class' => VerbFilter::className(),
'actions' => [ 'actions' => [
'delete' => ['POST'], 'delete' => ['POST'],
], ],
], ],
]; 'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
],
],
],
]
);
} }
/** /**

View File

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

View File

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