0

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.

asked Aug 27, 2019 at 13:16

1 Answer 1

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();
answered Aug 28, 2019 at 8:38
1
  • thanks, i will try as soon as i can and feedback to you, thanks for answer my question. Commented Aug 28, 2019 at 8:40

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.