S
S
Svetlana Galenko2018-10-23 18:22:26
Yii
Svetlana Galenko, 2018-10-23 18:22:26

Why can't yii2 see links?

Hello, I installed the template on yii2, but when checking the site through the browser, it simply does not see my images and therefore the site does not open. In the console, the browser gives the following errors:
5bcf3c765c9eb700364918.png
I prescribe these links to images:

<img src='<?=Url::toRoute( [ "/../images/logo.png" ] )?>'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2018-10-23
@swallow_97

It is not necessary to assign the path to statics to yii, why? Just write the path to the file, and configure the server so that it enters only those requests for which there are no statics to the entry point, in fact it should be standard:
https://github.com/yiisoft/yii2-app-advanced/blob /...
Accordingly, the picture will look like
this. The picture itself is located in the root of the site in the images folder. The site root is usually the web folder where you have your entry point (index.php)
The toRoute method you use builds a url based on the route where you specify the module, controller, action and parameters.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question