piribipipi Posted September 1, 2015 Share Posted September 1, 2015 (edited) Hi, i created a module, and im trying to obtain a link to a php inside the module. Im using this: $url= $this->context->link->getModuleLink('mymodule', 'validation.php', array('pps' => 1), Configuration::get('PS_SSL_ENABLED')); but link generated is: http:/storeX.com/module/mymodule/validation.php and its not correct, it should be: http://storeX.com/modules/mymodule/validation.php (including a "s" in module) whats happening? someone can help me?? thanks!! Edited September 1, 2015 by piribipipi (see edit history) Link to comment Share on other sites More sharing options...
coeos.pro Posted September 1, 2015 Share Posted September 1, 2015 1- what is your version ? 2- In https://github.com/PrestaShop/PrestaShop/blob/develop/config/defines.inc.php line 89 you have /module/ or /modules/ 3- have you a file override/classes/Link.php with the function getModuleLink ? Link to comment Share on other sites More sharing options...
herve25 Posted September 1, 2015 Share Posted September 1, 2015 Hello,You have no problem the redirection is good.The rewrite link of the modules controllers use the keyword "module" as you can see in the file class/Dispatcher.php 'module' => array( 'controller' => null, 'rule' => 'module/{module}{/:controller}', 'keywords' => array( 'module' => array('regexp' => '[_a-zA-Z0-9_-]+', 'param' => 'module'), 'controller' => array('regexp' => '[_a-zA-Z0-9_-]+', 'param' => 'controller'), ), 'params' => array( 'fc' => 'module', ), ), Link to comment Share on other sites More sharing options...
vekia Posted September 1, 2015 Share Posted September 1, 2015 this is proper url. method you use creates link to controllers, not to files! validation.php should be replaced with module front controller only then module will be "valid" and properly constructed 1 Link to comment Share on other sites More sharing options...
Mohamadou Ndiaye Posted September 2, 2015 Share Posted September 2, 2015 this is proper url. method you use creates link to controllers, not to files! validation.php should be replaced with module front controller only then module will be "valid" and properly constructed $url= $this->context->link->getModuleLink('mymodule', 'It should be a module front controller not a File', array('pps' => 1), Configuration::get('PS_SSL_ENABLED')); Link to comment Share on other sites More sharing options...
Hessam Posted April 13, 2020 Share Posted April 13, 2020 (edited) Why should I get from getModuleLink() method: /module instead of modules in my url? ps1.7.6.x In define.inc is also modules!! Edited April 13, 2020 by Hessam (see edit history) 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