amaneuz Posted May 26, 2017 Share Posted May 26, 2017 I want to create a page on PrestaShop, so I create a file in the folder controller:/contollers/front/MapageController.php Then in this file I insert this code: class MapageControllerCore extends FrontController { public $php_self = 'mapage'; public $page_name = 'ma-page'; public $ssl = true; /** * Initialize Ma Page controller. * * @see FrontController::initContent() */ public function initContent() { parent::initContent(); $this->context->smarty->assign('content_only', 0); $this->setTemplate('costumer/mapage'); } } And I create a mapage.tpl file in the costum folder: /Themes/classic/templates/customer When I view the map in the browser, I get this error: [PrestaShopException] No template found for costumer/mapage at line 68 in file classes/Smarty/TemplateFinder.php 63. return $tpl; 64. } 65. } 66. } 67. 68. throw new PrestaShopException('No template found for '.$template); 69. } 70. 71. private function getTemplateHierarchy($template, $entity, $id) 72. { 73. $entity = basename($entity); TemplateFinderCore->getTemplate - [line 1340 - classes/controller/FrontController.php] - [4 Arguments] FrontControllerCore->getTemplateFile - [line 1236 -classes/controller/FrontController.php] - [3 Arguments] FrontControllerCore->setTemplate - [line 50 -controllers/front/SportsHiverController.php] - [1 Arguments] SportsHiverControllerCore->initContent - [line 201 -classes/controller/Controller.php] ControllerCore->run - [line 366 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] someone can help me? Thank's 1 Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted May 27, 2017 Share Posted May 27, 2017 hi,you can echo $this->template to see whether the template file in the right position Link to comment Share on other sites More sharing options...
amaneuz Posted May 27, 2017 Author Share Posted May 27, 2017 u want to say : echo $this->setTemplate(); or echo $this->template? Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted May 27, 2017 Share Posted May 27, 2017 u want to say : echo $this->setTemplate(); or echo $this->template? echo $this->template; Link to comment Share on other sites More sharing options...
amaneuz Posted May 27, 2017 Author Share Posted May 27, 2017 don't worked ! Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted May 27, 2017 Share Posted May 27, 2017 (edited) don't worked ! yes,the position is not right, please check the position, it seems there is a typo $this->setTemplate('customer/mapage'); NOT $this->setTemplate('costumer/mapage'); Edited May 27, 2017 by Irder (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