I
I
Ioldyz2016-10-11 19:10:39
Yii
Ioldyz, 2016-10-11 19:10:39

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>

I hope my question is clear, thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Максим Федоров, 2016-10-12
@qonand

вообще подгрузка стилей прямо на станицу это очень костыльный вариант, который лучше не стоит использовать. Но можете это сделать в представлении с помощью registerCss, например:
$this->registerCss(include(<path-to-file>));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question