Jump to content

Edit History

Rhobur

Rhobur

For PS 1.7+ use this hook in your module's main class:

public function hookActionFrontControllerSetMedia()
        {
            Media ::addJsDef([
                'your_module_name' => $this -> context -> link -> getModuleLink($this -> name, 'display', [], true),
            ]);

            $this -> context -> controller -> registerJavascript('modules-your_module_name',
                'modules/' . $this -> name . '/views/js/front.js');
        }

It also works with hookHeader().

Rhobur

Rhobur

For PS 1.7+ use this hook in your module's main class:

public function hookActionFrontControllerSetMedia()
        {
            Media ::addJsDef([
                'your_module_name' => $this -> context -> link -> getModuleLink($this -> name, 'display', [], true),
            ]);

            $this -> context -> controller -> registerJavascript('modules-your_module_name',
                'modules/' . $this -> name . '/views/js/front.js');
        }

 

×
×
  • Create New...