M
M
m2broth2014-08-29 15:35:21
Yii
m2broth, 2014-08-29 15:35:21

How to get direct link to javascript/css files inside yii module?

There is a project in yii, it has a module that performs certain functionality. The goal is to access css or js files in a module without using assetmanager directly. For example, on an external page, set

<script src="http://test.ru/module/js/content.js"></script>

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-08-29
Protko @Fesor

Are you sure you want to do this? Perhaps if you describe why you need it, it will be easier to describe to you why it is better not to do it at all and how it is better to do it.
If you want to receive links to assets outside the presentation layer, something obviously went wrong. And yes, only through AssetManager or some of your own, if you really want to make a bike.
If you don't care and you just need to do it, just because you want to, then: the
absolute path to the file is the path to the webroot. If the file is not in the webroot, one way or another, you will have to copy it there. And this is the work of AssetManager.

M
m2broth, 2014-08-29
@m2broth

I also doubted this question, I just thought maybe I didn’t understand something. I need to make an embedable widget on a third-party site that will receive scripts / styles from my site. I would like it beautifully, using a modular system, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question