Jump to content

Load css and js file in ModuleAdminController


Recommended Posts

Hello,

 

I am developing a BO module for Prestashop.

 

For the view I need to add CSS and JS file. I add files in setMedia() function but it is not loaded.

 

Files are in /views/css and /views/js folders.

 

The module implementation extended from ModuleAdminController.

 

Someone has an idea ?

 

 

 

 

 

 

setmedia.php

Link to comment
Share on other sites

Javascript
$this->addJs('/modules/' . $this->module->name . '/views/js/<your-file>.js');

CSS
$this->addCSS('/modules/' . $this->module->name . '/views/css/<your-file>.css', 'all');

It needs to start with /modules so overridden css and js get loaded correctly

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...