tongtoanbs
(Jackson Tong)
1
I wanna pass parameters to the file that I’m gonna publish through asset, is there anyway I can archive it?
Example: test.php
<?php
echo $var;
And then pass the variable
$var = "Hello World";
through
Yii::$app->assetManager->publish('test.php')
Is this porsible to do it?
phtamas
(Phtamas)
2
I don’t think it’s possible. Asset Manager is designed specifically for static assets. Dynamic assets should be served via controller actions.
tongtoanbs
(Jackson Tong)
3
Thank you very much, it works.
paskuale
(Pellicanipasquale)
4
@phtamas I’m making a widget, how can i pass parameters to the asset using a controller?