• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Asset Loader Library

#7
All my controllers extends a base controller. In there I have 2 private arrays for JS and CSS files. I have functions to inject the right filenames in these array for different needs. Let say I need jQuery and Font Awesome, my controller method will call some function that will add the JS and CSS files required for jQuery and FontAwesome. When I'm ready to call the view, I call a function that creates the links to be included in the view. Then the view simply output that variable that contains the HTML snippet to include the JS and CSS files. So all I have in my controller will be something like this->addJquery(),this->addFontAwesome(), this->getHeader().
Test your translation files with Translation Tester
Reply


Messages In This Thread
Asset Loader Library - by MGatner - 03-14-2019, 08:28 AM
RE: Asset Loader Library - by MGatner - 03-15-2019, 05:45 PM
RE: Asset Loader Library - by dave friend - 03-17-2019, 10:10 AM
RE: Asset Loader Library - by PaulD - 03-16-2019, 09:29 AM
RE: Asset Loader Library - by includebeer - 03-16-2019, 04:43 PM
RE: Asset Loader Library - by MGatner - 03-16-2019, 04:59 PM
RE: Asset Loader Library - by MGatner - 03-16-2019, 04:52 PM
RE: Asset Loader Library - by includebeer - 03-16-2019, 05:13 PM
RE: Asset Loader Library - by MGatner - 03-16-2019, 05:57 PM
RE: Asset Loader Library - by MGatner - 03-17-2019, 04:55 PM
RE: Asset Loader Library - by MGatner - 03-18-2019, 02:21 PM
RE: Asset Loader Library - by MGatner - 03-19-2019, 09:31 AM
RE: Asset Loader Library - by MGatner - 03-25-2019, 02:10 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.