[email protected] Posted April 22, 2013 Share Posted April 22, 2013 (edited) I'm trying to create a Prestashop 1.5 module, which so far i can install, and it creates a root tab on the admin menu bar. I'm a bit new to the controller convention, and just trying to create a controller for one of the menu items below my root menu, which is called Reporting My controller is located at the following path: modules/printspec/controllers/admin/reporting.php and inside I have the following code: <?php class PrintspecReportingModuleAdminController extends ModuleAdminController { public function initContent() { parent::initContent(); $this->setTemplate('report.tpl'); } } and I'm trying to access it with the following URL: http : //mydomain.com/admin12345/index.php?controller=PrintspecReporting&token=... What am I misunderstanding and getting wrong here? PrestaShop says: The controller PrintspecReporting is missing or invalid. Edited April 22, 2013 by [email protected] (see edit history) Link to comment Share on other sites More sharing options...
[email protected] Posted April 22, 2013 Author Share Posted April 22, 2013 I think this link is going to answer my question: http://www.programmingtunes.com/prestashop-1-5-features-for-developers-part-1-modules/ Link to comment Share on other sites More sharing options...
[email protected] Posted April 22, 2013 Author Share Posted April 22, 2013 Did some changes, but my controller still hasn't been found. Following the link above, I changed my controller filename to AdminReporting.php, which contains: <?php class AdminReportingController extends ModuleAdminController { /** * Constructor */ public function __construct() { parent::__construct(); } /** * initContent */ public function initContent() { parent::initContent(); $this->setTemplate('report.tpl'); } } I'm trying to access it with the following URL: http : //mydomain.dev/admin12345/index.php?controller=AdminReporting&token=... Any idea why it's been reported as not found or invalid? Link to comment Share on other sites More sharing options...
[email protected] Posted April 22, 2013 Author Share Posted April 22, 2013 My issue was to do with the ps_tab table. I set the class name for my menu item to AdminReportingController, when it should have been AdminReporting. So my issue has been fixed now, with the help of the above link of course. 2 Link to comment Share on other sites More sharing options...
Sandeep Tiwari Posted October 26, 2015 Share Posted October 26, 2015 (edited) Hey How do you fixed it , My code is as follows : <?php class AdminTokenController extends ModuleAdminController { public function initContent() { echo 'hi'; die; parent::initContent(); // get a value from the GET request $code = strval(Tools::getValue('myvalue')); // try to add it to the configuratoion: if ($code && Configuration::updateValue('IS_VALUE', $code)) { echo "Thanks"; } else { echo "Error."; } } }and I am accessing it with : http://localhost/Briopresta/admin576bnngtd/index.php?controller=AdminToken&token=something Edited October 26, 2015 by Webexpert Rvtech (see edit history) Link to comment Share on other sites More sharing options...
Sandeep Tiwari Posted October 26, 2015 Share Posted October 26, 2015 It says "Controller not found" Link to comment Share on other sites More sharing options...
rickczsu Posted January 16, 2016 Share Posted January 16, 2016 Hi. Did you find solution. I have "Class not found problem" Link to comment Share on other sites More sharing options...
annaarun Posted October 6, 2016 Share Posted October 6, 2016 Hi, I too have the same issue. I tried adding menu from back office. Then if I have selected the home as parent its again giving me the error "class not found". After adding menu as sub menu of any other tab the error is not there but shows a white screen nothing else. Please explain if you have got a solution. Link to comment Share on other sites More sharing options...
annaarun Posted October 21, 2016 Share Posted October 21, 2016 (edited) Hi, My issue of displaying white page is solved. It was due to the error in loading tpl file. Errors will be hidden if its not in development mode. You can enable it in define.inc.php file in config folder. if (!defined('_PS_MODE_DEV_')) {define('_PS_MODE_DEV_', true);} It will be false by default. I got the error after enabling it. Edited October 21, 2016 by annaarun (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts