Answer the question
In order to leave comments, you need to log in
How to correctly write the path to the image in yii2?
At the end of the template page in layouts I have a script
$('.parallax-window').parallax({imageSrc: '/img/bg.jpg'});
Answer the question
In order to leave comments, you need to log in
$('.parallax-window').parallax({
imageSrc: <?=\yii\helpers\Url::toRoute(['/img/bg.jpg']);?>
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question