Jump to content

Method POST - FrontController


Recommended Posts

Hello guys,

 

I created a module that allows the client to submit a form, but I can't get the data from this form from a controller created by me.

 

my controller: 

class MyFormModuleFrontController extends ModuleFrontController
{

    public function __construct()
    {
        parent::__construct();
        $this->context = Context::getContext();

    }

    public function postProcess(){
        if (Tools::isSubmit('mymod_product')) {
            var_dump($_POST);
            die('I\'m here!!');
        }
    }
...

A part of the form code

...
<form action="{$link->getModuleLink('mymod')}" method="post" id="mymod_frm" enctype="multipart/form-data">
					<div class="mymod_form_container">
						<div class="intro_form">{$terms}</div>
						<div class="left">
...
<p class="submit">
<input id="mymod_product" name="mymod_product" type="hidden" value="{$product->id|escape:'htmlall':'UTF-8'}" />

....

The structure of my module:

 

.../modules/mymod/controllers/MyForm.php (controller)

.../modules/mymod/views/template/front/form.tpl (form page)

Link to comment
Share on other sites

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...