Jump to content

Problème avec addJS


jd440

Recommended Posts

Bonjour à tous.

 

Voilà j'essaye de developper un module tout simple pour simplement ajouter un fichier JS dans le header

 

Mais je comprend pas, car le module s'installe, s'accroche, mais le JS ne s'ajouter pas?

 

Si quelqu'un trouve ou je fait un erreur:

   <?php

if (!defined('_PS_VERSION_'))
    exit;
class LazyLoad extends Module
{
    public function __construct() {
 
        $this->name = 'lazyload';
        $this->tab = 'front_office_features';
        $this->version = 1.0;
        $this->author = 'jd440';
        $this->displayName = $this->l('Lazyload');
        $this->description = $this->l('Lazyload');
 
        parent :: __construct();
 
    }
    public function install() {
        return parent :: install()
        && $this->registerHook('displayHeader');
    }

    public function displayHeader($param)
    {
        $this->context->controller->addJS($this->_path.'js/jquery.lazyload.min.js');
    }
}

Merci d'avance.

Edited by jd440 (see edit history)
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...