Add CSS in controller.

if (version_compare(_PS_VERSION_, ‘1.6.0’, ‘<‘)) {
$this->context->controller->addCSS($this->module->getPathURI().’/views/css/admin15.css’);
}

//  loaded css and js in module controller

public function setMedia() {

parent::setMedia();

$this->context->controller->registerStylesheet(‘affiliatestyle-css’,’modules/’.$this->module->name.’/css/affiliatestyle.css’,[‘media’ => ‘all’, ‘priority’ => 0]);

$this->context->controller->registerJavascript(‘sendtoafriend-js’,modules/’.$this->module->name.’/’sendtoafriend.js’,[‘position’ => ‘bottom’, ‘priority’ => 0]);

}

add css and js in a Header or footer hook

$this->context->controller->registerJavascript(‘sendtoafriend-js’,$this->_path.’/css/js/sendtoafriend.js’,[‘position’ => ‘bottom’, ‘priority’ => 0]);

$this->context->controller->registerStylesheet(‘sendtoafriend-css’,$this->_path.”/css/sendtoafriend.css’,[‘position’ => ‘bottom’, ‘priority’ => 0]);

 

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...