Re: how to create a form and add it to a page?
Yes, you're right regarding the form id. X-Cart 5 signs most of the forms in the back-end and some of the forms in the storefront to prevent hackers from submitting malicious data in these forms.
\XLite\Controller\AController::needFormId() static method defines whether the controller class requires forms to be signed, or not. For back-end pages it always return "true", so all back-end forms are protected out of the box.
There is one more method: \XLite\Controller\AController::defineFreeFormIdAct ions(). It defines a list of controller actions that should bypass the form id checking. If you want your action to skip the form id check, you should find the controller that handles the form and add the name of the action to the list generated by this method of that controller class.
|