Combining Javascript and CSS files to lower loading times. |
[eluser]Armorfist[/eluser]
I took a different approach and included the script as a controller. You can download it here. To make it work, extract the config and the controller to your CI directory, then open the combine.php config file and edit the css and javascript paths (the cache path is /system/cache by default). To load the files go to: http://yourdomain/combine/index/type/files Example: http://yourdomain/combine/index/javascri....js-moo.js http://yourdomain/combine/index/css/admi...-style.css I changed the separation character as you might noticed, thats because CI's URI system doesn't let you put "," or "|" on the url. So to separate the files you use "-" instead. Don't know if this is the correct approach in the MVC model. I'm thinking to implement this system in a library, if i do, i will post it here. Hope this helps. Edit: I don't think caching is working very well this way, if you have caching enabled and remove cache files under firefox, it stops working for some reason. I advise you to leave cache FALSE, and to set a non existent cache directory to make sure it doesn't cache the files. The script has some bugs. |
Messages In This Thread |
Combining Javascript and CSS files to lower loading times. - by El Forum - 02-07-2008, 08:41 AM
Combining Javascript and CSS files to lower loading times. - by El Forum - 02-07-2008, 08:58 AM
Combining Javascript and CSS files to lower loading times. - by El Forum - 02-07-2008, 09:50 AM
Combining Javascript and CSS files to lower loading times. - by El Forum - 02-07-2008, 10:19 AM
Combining Javascript and CSS files to lower loading times. - by El Forum - 02-07-2008, 10:24 AM
Combining Javascript and CSS files to lower loading times. - by El Forum - 02-07-2008, 11:22 AM
Combining Javascript and CSS files to lower loading times. - by El Forum - 02-07-2008, 11:42 AM
Combining Javascript and CSS files to lower loading times. - by El Forum - 01-09-2009, 10:21 AM
|