I'm adding Symfony Webpack Encore to an existing project with native php
templates, so without the use of Twig. Refactoring the whole project to Twig is not worth the effort now.
The following Twig code is proposed in the Webpack Encore documentation to render the JS script
tags and the CSS link
tags.
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
{% block javascripts %}
{{ encore_entry_script_tags('app') }}
{% endblock %}
So I would like to implement the same code without using Twig. These Twig functions use the TagRenderer
and EntrypointLookup
classes. How can I initiate the required models and mimic the functionality of the Twig functions?