Import or include simple txt file

I’m trying to just include a txt file with either html in it or css. Do I have to create a template for it the templates folder? It seems like I should just be able to pull it into one of the modular files using:

{% include page.route ~ '/file.txt' ignore missing %}

Twig doesn’t support this out of the box. You can create a simple Twig extension (using smartypants plugin as an example perhaps) that simple does a file_get_contents().

Discussed here for Symfony framework:

Actually give me a few minutes, and i’ll do it :slight_smile:

There you go, that should do what your are looking for. Enjoy.