Browse Source

Параметр debug в авто-режиме

master v5.15.4-r3
parent
commit
c3b6e31b8f
  1. 16
      protected/components/FontAwesome5Component.php

16
protected/components/FontAwesome5Component.php

@ -20,7 +20,7 @@ class FontAwesome5Component extends CApplicationComponent
// Global options
public $debug = false;
public $debug = null; // null == авто-режим
public $cdn = false;
@ -39,6 +39,18 @@ class FontAwesome5Component extends CApplicationComponent
public function init()
{
$this->cdnUrl .= '/' . self::VERSION . '/css';
if ($this->debug === null) {
if (defined('YII_DEBUG') && YII_DEBUG === true) {
$this->debug = true;
}
if (defined('YII_ENV') && YII_ENV == 'dev') {
$this->debug = true;
}
}
if ($this->debug === null) {
$this->debug = false;
}
parent::init();
}
@ -92,7 +104,7 @@ class FontAwesome5Component extends CApplicationComponent
$url = $this->localUrl;
}
if (!$this->debug) {
if ($this->debug === false) {
if (strpos($cssFile, '.min.css') === false) {
$cssFile = str_replace('.css', '.min.css', $cssFile);
}

Loading…
Cancel
Save