Jump to content

[Solved] Building Custom Back Office Page, Form Post Data


Recommended Posts

I have successfully created my custom back office page.

 

In that page I want to have a form, which will update data using the same admin controller showing that page.

(This is a common case in the prestashop core admin controllers, isn't it?)

 

When I access the page from the menus (which accessed via "GET" http method) all's working fine,

but when the form is submitted ("POST" http method) I'm getting redirected to my back office dashboard.

 

I put the form action url in the smarty template for the page like that:

<form action="index.php?controller=myclass&token={Tools::getAdminTokenLite('myclass')}">

As you can see 'myclass' there is the class name as shown in the working (get) url as a value for the "?controller=" url variable.

 

I guess it have something to do with the token in url, but maybe I missing here the correct approach to forms submitting at admin controllers?

 

Thanks in advance!

Edited by Nati Mask (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...