Answer the question
In order to leave comments, you need to log in
How to set the path to img?
What am I confused about.
I have a modal window in my template main.php
, which opens by clicking in the topbar and an image opens in it at the address
"../img/map/metro.png" alt="" class="img-responsive">
SiteController actionIndex
). SiteController - actionSecond
) - the modal window opens in the same way, but the Second method is added to the image address and, accordingly, is not shown. those. coming outsite.ru/second/img/map/metro.png - 404
Answer the question
In order to leave comments, you need to log in
Replace "../img/map/metro.png" with an absolute path, in your case, probably "/img/map/metro.png" and forget about problems with opening images.
Try to display image like this
look at Predefined Aliases and indicate at the beginning, so you will immediately know where to get them from.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question