TheAngelM Posted February 26, 2017 Share Posted February 26, 2017 I am writing a module and I am returning a view in the getContent method like this: public function getContent() { return $this->display(__FILE__, 'views/templates/admin/product_crawler.tpl'); } the product_crawler.tpl file looks like this: <form method="POST" action="{$this->context->link->getAdminLink('ProductCrawlerGet')}"> <input type="text" name="url"> <input type="submit"> </form> and in /modules/product_crawler/controllers/admin/ folder I have a getproducts.php file which looks like this: <?php /** * */ class ProductCrawlerGetController extends ModuleAdminControllerCore { public function postProcess() { if (Tools::isSubmit('url')) { // form processing return 'success'; } } } ?> and when I press the configure on the module it shows a blank page, and when I remove the action link it shows the form correctly What am I doing wrong ? Link to comment Share on other sites More sharing options...
NemoPS Posted March 1, 2017 Share Posted March 1, 2017 You can't use $this in the tpl file, get the link before, use smarty assign and the variable name instead, in the template Anyway make sure you keep debug mode enabled in defines.inc.php Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now