I've been attempting to utilize the javascript function document.write
to incorporate an external css
file in my template. However, I am aiming to achieve this using Twig
, like so:
document.write('<link href="{{ asset('bundles/activos/css/app-orange.css') }}" rel="stylesheet" >');
Unfortunately, it does not seem to work. Why is the document.write
function failing? Can I include that Twig
code within it?
Alternatively, what is the most effective way to pass a css
route with Twig
to a document.write
javascript function?
Apologies if my English is not perfect. I hope my message comes across clearly. Thank you.