sharif854 Posted October 12, 2012 Share Posted October 12, 2012 hi i create frontController in my module and this is work but in setMedia i add css and js file but not loaded in head i check by firebug i'ts not exists my code : class myController extends FrontcontrollerCore { . . . . . public function setMedia() { parent::setMedia(); Tools::addJS(dirname(__FILE__).'/js/testfile.js'); Tools::addCSS(dirname(__FILE__).'/tests.css'); } } please help csss and js file is exsits in my module thank you Link to comment Share on other sites More sharing options...
sharif854 Posted October 15, 2012 Author Share Posted October 15, 2012 (edited) any body don't know about that? ok i try to solve this problem myself i waste couple hours and i can solve this i read the Tools::addCss and i realized that i have to include path from base url like PS_BASE_URL_ or _MODULE_DIR_ the code of setmedia function should be like this: public function setMedia() { parent::setMedia(); Tools::addJS(_MODULE_DIR_.'moduleName/js/testfile.js'); Tools::addCSS(_MODULE_DIR_.'moduleName/tests.css'); } we can use _PS_BASE_URL_ or other url path defines just we can't use dirname(__FILE__) thank you Edited October 15, 2012 by sharif854 (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now