Jump to content

SOLVED - Custom module controller


Recommended Posts

Hi,

 

I made a custom module that I register in displayTopColumn hook. It is a basic form (email, name and a text area) and I want process but it doesn't work. My module folder structure is:

mymodule/

  mymodule.php

  controllers/

    front/

      validate.php

  views/

    templates/

      front/

        mymodule.tpl

 

So I'm trying a basic action: when I submit the form, redirect to 'index.php'. This is my controller code:

<?php

if (!defined('_PS_VERSION_'))
        exit;
        
class AaaValidateController extends ModuleFrontController {
    public function initContent() {
        parent::initContent()
        Tools::redirect('index.php');
    }
}

 

Problem is that when I try 'domain/module/mymodule/validate' it returns a white page, no an error, so I don't know what to do.

And one question: if I modify the controller or main file of my module, do i have to reset it? Or doesn't it matter?

Thanks in advance.

Edited by felix7 (see edit history)

Share this post


Link to post
Share on other sites
  • 4 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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More