I'm working on simple CRUD (create, read, update and delete) module without grid or ui component, just simple CRUD.
So when i'm trying to create add/edit form, i've meet some weird issue, when i click on add/edit button, it redirect to my admin dashboard (At first i think it was acl.xml problem, but it wasn't).
The controller for edit/add is almost excactly like the list/manage controller.
enter image description here
I've try to find the problem many hours but no chance.
Here is my module, please take a look.
Thanks.
1 Answer 1
You get URL without formkey.
Add to your
Aht\Custom\Block\Adminhtml\Department\Manage.php
public function getAddUrl()
{
return $this->getUrl('department/manage/add');
}
and change in
view/adminhtml/templates/department/manage.phtml
$addlUrl = $adminUrl . '/department/manage/add';
to
$addlUrl = $block->getAddUrl();
-
thanks, i will try as soon as i can and feedback to you, thanks for answer my question.fudu– fudu2019年08月28日 08:40:25 +00:00Commented Aug 28, 2019 at 8:40