Reputation: 153
How can I stop Yii2 from loading the pjax asset file automatically when I use the Pjax widget? I want to load it myself from a CDN. I've tried this:
'assetManager' => [
'bundles' => [
'yii\web\PjaxAsset' => [
'js'=>[]
],
],
],
But that doesn't do anything. Any suggestions?
Upvotes: 0
Views: 782
Reputation: 1
Alternative you could choose to disable specific asset bundle.
If you want to disable specific asset, use this:
'assetManager' => [
'bundles' => [
'yii\web\PjaxAsset' => false,
],
]
If you want to disable whole asset bundles, use this:
'assetManager' => [
'bundles' => false,
]
Upvotes: 0
Reputation: 18021
Use
'assetManager' => [
'bundles' => [
'yii\web\PjaxAsset' => [
'sourcePath' => null,
'js'=> ['//cdn.url.you/want/to/use']
],
],
],
Upvotes: 1