1) Weltweit ist es mit Hilfe von AssetMananer möglich. Hierfür gibt es eine spezielle Option $forceCopy.
Sie können es so eingestellt mit Komponente:
use Yii;
Yii::$app->assetManager->forceCopy = true;
Oder in Anwendung config:
'components' => [
'assetManager' => [
'class' => 'yii\web\AssetManager',
'forceCopy' => true,
],
],
2) Wenn Sie Caching in bestimmten AssetBundle deaktivieren möchten, verwenden Sie $publishOptions Eigenschaft:
public $sourcePath = '...' // In order to use $publishOptions you should specify correct source path.
public $publishOptions = [
'forceCopy' => true,
];
Alternativ können Sie dies wie in Option 1 mit Hilfe der Eigenschaft bundles angeben. Zum Beispiel:
'components' => [
'assetManager' => [
'class' => 'yii\web\AssetManager',
'forceCopy' => true,
'bundles' => [
'yii\bootstrap\BootstrapAsset' => [
'forceCopy' => true,
],
],
],
],
Aber:
'forceCopy' => YII_DEBUG,
ist flexibler, weil es nur im Debug-Modus diesen Asset-Bundle-Caching deaktiviert, sondern ermöglicht auf Produktionsserver. YII_DEBUG
wird in web/index.php
festgelegt.
So verwenden Sie Yü oder Yii2? – arogachev
Hallo, ich benutze Yii2. – Kupigon