Jump to content

Back Office View / Smarty / Uncaught exception 'SmartyException' with message 'Unable t


Recommended Posts

Hello !

 

I am working on the implementation of a Prestashop Back Office module. I added the new Tab in the install file

I have error messages on the display of the view.

 

The Admin Controller file is in attachment.

 

The module name is : mydashboard

 

I placed the tpl file in the folder /web/modules/mydashboard/views/templates/admin/mydashboard

 

 

Error messages are

 

/var/www/clients/client2986/web12226/web/modules/mydashboardFatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file '/var/www/clients/client2986/web12226/web/admin11/themes/default/template//var/www/clients/client2986/web12226/web/modules/mydashboard/views/templates/admin/mydashboard/dashboard.tpl'' in /var/www/clients/client2986/web12226/web/tools/smarty/sysplugins/smarty_internal_templatebase.php:127 Stack trace: #0 /var/www/clients/client2986/web12226/web/classes/controller/AdminController.php(1152): Smarty_Internal_TemplateBase->fetch() #1 /var/www/clients/client2986/web12226/web/classes/controller/Controller.php(185): AdminControllerCore->display() #2 /var/www/clients/client2986/web12226/web/classes/Dispatcher.php(348): ControllerCore->run() #3 /var/www/clients/client2986/web12226/web/admin11/index.php(50): DispatcherCore->dispatch() #4 {main} thrown in /var/www/clients/client2986/web12226/web/tools/smarty/sysplugins/smarty_internal_templatebase.php on line 127

AdminMyDashboardController.php

Edited by dems (see edit history)
Link to comment
Share on other sites

I think you should move your initContent code to renderView, and render and return your template from their.  The initContent renders the html to be displayed inside the general layout of the admin screens. 

 

Not exactly sure what happens when you call setTemplate from the initContent function, it will be calling the createTemplate function on the AdminController and not the ModuleAdminController, so it's probably looking for a controller template to override, and since you don't have an override_folder value set, I'm not sure where it is looking for the template.  lebriconome by the looks of the error message.

 

(Basically it's looking in a different place than you think for the template, and can't find it..)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...