Skip to content

Instantly share code, notes, and snippets.

@SDKiller
Created July 6, 2014 20:54
Show Gist options
  • Save SDKiller/f5b3e9b82658ad566769 to your computer and use it in GitHub Desktop.
Save SDKiller/f5b3e9b82658ad566769 to your computer and use it in GitHub Desktop.
AssetManager override
<?php
namespace common\components;
use Yii;
use \yii\web\AssetManager;
class AssetManagerDev extends AssetManager
{
public $publishOptions = [];
public function publish($path, $options = [])
{
$options = array_merge($this->publishOptions, $options);
return parent::publish($path, $options);
}
}
@SDKiller
Copy link
Author

SDKiller commented Jul 6, 2014

And in application config

    'components' => [
        ...
        'assetManager' => [
            'class' => 'common\components\AssetManagerDev',
            'publishOptions' => [
                'forceCopy' => true
            ],
        ],
        ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment