lozitax Posted May 24, 2020 Share Posted May 24, 2020 Bonsoir, J'aimerais charger un fichier JS dans un controller, mais quand je met le code : $this->context->controller->addJS($this->_path.'views/js/accordeon.js'); j'obtiens cette erreur : Notice: Trying to get property 'controller' of non-object Si quelqu'un à la solution je suis preneur Merci beaucoup Link to comment Share on other sites More sharing options...
Eolia Posted May 24, 2020 Share Posted May 24, 2020 Euh... vous êtes déjà dans le contrôleur^^ Link to comment Share on other sites More sharing options...
lozitax Posted May 24, 2020 Author Share Posted May 24, 2020 Enfaite je débute donc je galère un peu mdrr... Ducoup je dois mettre quel code ? Link to comment Share on other sites More sharing options...
Eolia Posted May 24, 2020 Share Posted May 24, 2020 public function setMedia() { parent::setMedia(); $this->addJS(_THEME_JS_DIR_.'accordeon.js'); } suffit ($this->_path c'est pour les modules pas pour les controleurs^^) Link to comment Share on other sites More sharing options...
lozitax Posted May 24, 2020 Author Share Posted May 24, 2020 D'accord merci beaucoup 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