Answer the question
In order to leave comments, you need to log in
How to load scripts / styles in YII2 not with a link, but with embedding in the page?
Good evening!
Wrote a single-page application in a large enterprise, the network works like this.
The application, for example, is located at 192.168.0.93 .
Direct access is allowed, that is, when entering this page, only 192.168.0.93/web/index.php is loaded and nothing more. That is 192.168.0.93/web/assets/xxxx/bootstrap.css etc. not loading .....
I can’t agree with the admins, so I wondered if it was possible to automatically load scripts / styles
somehow, that is, not
to be something like that<link rel="stylesheet" href="XXXX.css">
<style>
<?=include("xxxx.css")?>
</style>
Answer the question
In order to leave comments, you need to log in
вообще подгрузка стилей прямо на станицу это очень костыльный вариант, который лучше не стоит использовать. Но можете это сделать в представлении с помощью registerCss, например:$this->registerCss(include(<path-to-file>));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question