I need to add via addJs
method javascript code, that is dynamically created and dependent of php variables.
I got all javascript at the end of the page, so I want core js files to load first and then my custom file to be loaded - that is why I cannot do it in the view.
So I parsed it as a view with partial
, and now I need to somehow pass it to addJs method.
How it can be done, or mayby there is a more natural way to do that?
UPD: I got custom files of .pjs
extensions interpreted as php code but assigned Content-Type
header of application/javacsript
. How do I handle them inside of phalcon?