Commit 7f636fc5 by Klimov Paul

`yii\console\controllers\AssetController::actionTemplate()` advanced to include…

`yii\console\controllers\AssetController::actionTemplate()` advanced to include `jsCompressor` and `cssCompressor` to the template.
parent 72aba342
...@@ -573,6 +573,9 @@ EOD; ...@@ -573,6 +573,9 @@ EOD;
*/ */
public function actionTemplate($configFile) public function actionTemplate($configFile)
{ {
$jsCompressor = var_export($this->jsCompressor, true);
$cssCompressor = var_export($this->cssCompressor, true);
$template = <<<EOD $template = <<<EOD
<?php <?php
/** /**
...@@ -581,6 +584,10 @@ EOD; ...@@ -581,6 +584,10 @@ EOD;
* Please define these missing path aliases. * Please define these missing path aliases.
*/ */
return [ return [
// Adjust command/callback for JavaScript files compressing:
'jsCompressor' => {$jsCompressor},
// Adjust command/callback for CSS files compressing:
'cssCompressor' => {$cssCompressor},
// The list of asset bundles to compress: // The list of asset bundles to compress:
'bundles' => [ 'bundles' => [
// 'yii\web\YiiAsset', // 'yii\web\YiiAsset',
......
...@@ -240,6 +240,8 @@ EOL; ...@@ -240,6 +240,8 @@ EOL;
$configFileName = $this->testFilePath . DIRECTORY_SEPARATOR . 'config.php'; $configFileName = $this->testFilePath . DIRECTORY_SEPARATOR . 'config.php';
$this->runAssetControllerAction('template', [$configFileName]); $this->runAssetControllerAction('template', [$configFileName]);
$this->assertTrue(file_exists($configFileName), 'Unable to create config file template!'); $this->assertTrue(file_exists($configFileName), 'Unable to create config file template!');
$config = require($configFileName);
$this->assertTrue(is_array($config), 'Invalid config created!');
} }
public function testActionCompress() public function testActionCompress()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment