Jump to content

[RESOLU] Surchage du Controller


Recommended Posts

bonjour,

Je tente d'ajouter un nouveau hook en utilisant la surcharge du core.

J'ai créé un nouveau fichier IndexController.php dans le répertoire overrides/controllers

J'ai ajouté le code suivant

<?php
class IndexController extends IndexControllerCore
{
   public function process()
   {
   parent::process();

   $this->smarty->assign('HOOK_HOME_SUPP', Module::hookExec('home'));
   }
}

?>



Mais voici le message d'erreur que j'obtiens :

Notice: Undefined property: IndexController::$smarty in /srv/d_netskiss24/www/animalcadeaux.com/htdocs/override/controllers/IndexController.php on line 8 Fatal error: Call to a member function assign() on a non-object in /srv/d_netskiss24/www/animalcadeaux.com/htdocs/override/controllers/IndexController.php on line 8

Prestashop 1.4

Merci beaucoup à tous,

Link to comment
Share on other sites

Il faut mettre :

<?php
class IndexController extends IndexControllerCore
{
   public function process()
   {
   parent::process();

   $smarty->assign('HOOK_HOME_SUPP', Module::hookExec('home'));
   }
}

?> 

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...