admin init command
This commit is contained in:
@ -76,21 +76,20 @@ class OptionController extends AdminController
|
||||
*/
|
||||
public function actionEdit(int $id): void
|
||||
{
|
||||
Debug::prn($_REQUEST);
|
||||
$option = Option::find($id);
|
||||
if (!$option) {
|
||||
throw new \Exception('Option not found');
|
||||
}
|
||||
$optionForm = new CreateOptionForm();
|
||||
$optionService = new OptionService();
|
||||
$optionForm->load($_REQUEST);
|
||||
if ($optionForm->validate()) {
|
||||
$option = $optionService->update($optionForm, $option);
|
||||
$option = $this->optionService->update($optionForm, $option);
|
||||
if ($option) {
|
||||
$this->redirect('/admin/option' . $option->id);
|
||||
$this->redirect('/admin/option/' . $option->id);
|
||||
}
|
||||
}
|
||||
$this->redirect('/admin/option/update' . $id);
|
||||
|
||||
$this->redirect('/admin/option/update/' . $id);
|
||||
}
|
||||
|
||||
#[NoReturn] public function actionDelete(int $id): void
|
||||
|
Reference in New Issue
Block a user