passio Posted January 15, 2018 Share Posted January 15, 2018 (edited) Bonjour, j'ai vraiment l'impression d'être dans un problème à 2 francs... Mais j'ai acheté un bouquin il y a 5 jours pour créer un module et je n'ai pas programmé depuis des années. En fait, mon but c'est d'afficher un minuteur Javascript dans un FrontController.... J'ai plusieurs soucis... J'arrive à inclure un fichier .JS ainsi depuis getContent() (dans monmodule.php) pour ma page de config... Mais dans la méthode initcontent de payment.php, ça ne marche pas;.. $this->context->controller->addJS($this->_path.'views/js/minuteur.js'); Cependant, pour mon frontcontroller payment.php, je n'y arrive pas... (dans module/controllers/front/payment.php) comment inclure mon fichier monmdule/views/js/minuteur.js ? J'essaye tous les chemins possible ça ne passe pas... Edited January 15, 2018 by passio (see edit history) Link to comment Share on other sites More sharing options...
passio Posted January 15, 2018 Author Share Posted January 15, 2018 J'ai respecté les conventions écrites dans le livre, donc j'appelle : public function hookDisplayPayment($params) { $controller = $this->getHookController('displayPayment'); return $controller->run($params); } Ceci crée le bouton de payment (là ou il y a chèqe, cb, paypal, etc...) Quand on clique sur le bouton, on est envoyé dans un front controller "payment.php" Si j'ajoute un fichier .js dans la méthode hookdispaypayment, à cet endroit ça passe... Dans les hooks ça passe, mais directement dans le frontcontroller dans la méthodes initContent non... Link to comment Share on other sites More sharing options...
passio Posted January 15, 2018 Author Share Posted January 15, 2018 Probleme résolu en utilisant : $this->module->getPathUri() (Je ne sais pas pourquoi). 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