1) Küresel olarak AssetMananer yardımıyla mümkündür. Bunun için özel bir seçenek $forceCopy var.
Sen bileşeni ile böyle ayarlayabilirsiniz:
use Yii;
Yii::$app->assetManager->forceCopy = true;
Veya uygulama config
:
'components' => [
'assetManager' => [
'class' => 'yii\web\AssetManager',
'forceCopy' => true,
],
],
2) Eğer belirli AssetBundle yılında önbelleğe alma devre dışı kullanmak istiyorsanız $publishOptions özelliği:
public $sourcePath = '...' // In order to use $publishOptions you should specify correct source path.
public $publishOptions = [
'forceCopy' => true,
];
Alternatif olarak, bu seçeneği bundles özelliğiyle 1 numaralı gibi belirtebilirsiniz.
'components' => [
'assetManager' => [
'class' => 'yii\web\AssetManager',
'forceCopy' => true,
'bundles' => [
'yii\bootstrap\BootstrapAsset' => [
'forceCopy' => true,
],
],
],
],
Ama bu: Örneğin sadece hata ayıklama modunda bu varlık demeti hafızasını kapatır çünkü
'forceCopy' => YII_DEBUG,
, daha esnektir, ancak üretim sunucusunda izin verir. YII_DEBUG
, web/index.php
'da ayarlanır.
Yii veya Yii2 kullanıyorsunuz? – arogachev
Merhaba, Yii2 kullanıyorum. – Kupigon