-
Book Overview & Buying
-
Table Of Contents
CakePHP 2 Application Cookbook - Third Edition
By :
The handling of static assets, such as scripts and stylesheets, is an important aspect of applications that are expected to perform and deliver content quickly.
In this recipe, we'll look at how to include and set up the AssetCompress plugin to make sure we're serving content quickly and efficiently, without putting a burden on the server when the users are coming.
The AssetCompress plugin can be found at https://github.com/markstory/asset_compress.
The content of this plugin needs to be added in app/Plugin/AssetCompress/ and then loaded in your application. To do so, add the following code in your bootstrap.php file located in app/Config/:
CakePlugin::load('AssetCompress', array('bootstrap' => true));This should be added before the section of the file that calls the following:
Configure::write('Dispatcher.filters', array(
'AssetDispatcher',
'CacheDispatcher'
));Now, create an app.js file...
Change the font size
Change margin width
Change background colour