P
P
Pavel Gogolinsky2014-11-25 15:52:59
Yii
Pavel Gogolinsky, 2014-11-25 15:52:59

Why is assetManager empty in view?

In layout in Yii::$app->assetManager->bundles I can see all connected resources.
But in the view that is rendered through this layout Yii::$app->assetManager->bundles is empty. Why?
How can I define the baseUrl in the view if I include resources in the layout in this way?

$asset = app\modules\admin\components\AdminAsset::register($this);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vyachin, 2015-06-04
@vyachin

www.yiiframework.com/doc-2.0/guide-structure-asset...
Connect your resource in the view. Don't worry, it won't connect a second time.
$asset = app\modules\admin\components\AdminAsset::register($this);
everything here is $asset->baseUrl

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question