Skip to content

Commit

Permalink
Merge pull request #113 from FriendsOfCake/assetcompress
Browse files Browse the repository at this point in the history
Make usage of AssetCompress configurable.
  • Loading branch information
josegonzalez committed Apr 28, 2016
2 parents d8a7b03 + 6b3ce21 commit 7ff2418
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config/defaults.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
use \Cake\Core\Plugin;

return [
'CrudView' => [
'brand' => 'Crud View',
Expand All @@ -22,5 +24,6 @@
]
],
'timezoneAwareDateTimeWidget' => false,
'useAssetCompress' => Plugin::loaded('AssetCompress')
]
];
4 changes: 2 additions & 2 deletions src/View/CrudView.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function initialize()
*/
protected function _loadAssets()
{
if (Plugin::loaded('AssetCompress')) {
if (Configure::read('CrudView.useAssetCompress')) {
$this->AssetCompress->css('CrudView.crudview', ['block' => true]);
$this->AssetCompress->script('CrudView.crudview_head', ['block' => 'headjs']);
$this->AssetCompress->script('CrudView.crudview', ['block' => true]);
Expand Down Expand Up @@ -95,7 +95,7 @@ protected function _setupHelpers()
$this->loadHelper('CrudView.CrudView');
$this->loadHelper('BootstrapUI.Flash');

if (Plugin::loaded('AssetCompress')) {
if (Configure::read('CrudView.useAssetCompress')) {
$this->loadHelper('AssetCompress.AssetCompress');
}
}
Expand Down

0 comments on commit 7ff2418

Please sign in to comment.