Jump to content
jd440

Problème avec addJS

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)

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More