A
A
Artem2016-07-08 13:16:56
Yii
Artem, 2016-07-08 13:16:56

How to connect yii2 to self-written system? Problem with relative paths?

I managed to connect yii2 to the handwritten system, but there are some small problems.
in the code of the manuscript, I render the template:

echo (new View())->renderFile('@app/views/new/index.php', ['data'=>$dataRender]);

And in the template I use yii\bootstrap\Tabs and it gives me an error:
Fatal error: Uncaught exception 'yii\base\InvalidConfigException' with message 'The directory does not exist: /var/www/loc/dream.devnull/assets' in /var/www/loc/m.masterlock.devnull/vendor/yii2/vendor/yiisoft/yii2/web/AssetManager.php:211 Stack trace: #0

That is, it reads the assets folder from the root.
What does it have to do with the environment variable when displaying @app - it displays the path from the root of the site to me, but I need the root / vendor / yii2
More precisely, in @app the path goes to folders with yii2.
But why does Tabs read from the root.
Tell me, please, what do I need to do so that the paths are read from a specific folder?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2016-07-08
@webinar

Just create an assets folder for him wherever he wants or override it in assets.php
www.yiiframework.com/doc-2.0/guide-structure-asset...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question