enSysRanjit Posted November 10, 2014 Share Posted November 10, 2014 (edited) Hello everybody, I am trying to create new custom admin controller.But It gives error 'Controller not found'.I just add one link and create a new controller in my module(MyModule/controllers/admin) folder Link code is: <a href='{$link->getAdminLink('AdminRecommendations')|escape:'html':'UTF-8'}&id_order={$id_order}' > <input type='button' class='btn btn-primary' name='recommendation' value='Recommendations'/> </a> and I created controller as: <?php class AdminRecommendationsController extends ModuleAdminController { public function __construct() { parent::__construct(); $this->postProcess(); die; } public function postProcess() { echo "Hello..."; exit(); parent::postProcess(); } } But I am getting error 'Controller not found'. Please help me. Thanks!!! Edited November 14, 2014 by enSysRanjit (see edit history) Link to comment Share on other sites More sharing options...
zelakioui Posted February 9, 2016 Share Posted February 9, 2016 (edited) you should extends AdminController class, your class should be like this one : class AdminmymoduleController extends AdminController { public function __construct() { parent::__construct(); } public function renderForm(){ //some basics information, only used to include your own javascript $this->context->smarty->assign(array( 'mymodule_controller_url' => $this->context->link->getAdminLink('Adminmymodule'),//give the url for ajax query )); //what do we want to add to the default template $more = $this->module->display($path, 'view/mymodule.tpl'); return $more.parent::renderForm();//add you own information to the rendered template } } Edited February 9, 2016 by zelakioui (see edit history) Link to comment Share on other sites More sharing options...
jgamio Posted February 14, 2016 Share Posted February 14, 2016 The before answer in not correct You can use ModuleAdminController But you need take care of the name Admin ModuleName Recommendations Controller 1 Admin 2 You Module Name 3 Your Controller Name 4 Controller 1 Link to comment Share on other sites More sharing options...
jmarceli Posted January 23, 2017 Share Posted January 23, 2017 I was having exactly the same problem with 'Controller not found' and I found an answer here: https://www.prestashop.com/forums/topic/512932-controller-not-found/ It turns out that you need to register "invisible" module Tab in order to tell Prestashop about your custom ModuleAdminController. 1 Link to comment Share on other sites More sharing options...
Mohamed Eid Posted September 15, 2022 Share Posted September 15, 2022 it should be extends "ModuleAdminController" 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