We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Get File Name using Volt template

Hi all, How to get file name use Volt template? ex: In file test.volt ---> {{ FILE }} -> result: test

Hi @thanhansoft do you try with {{ dump(voltService) }} probably there you can find the file name... Good luck

Thanks for reply, It's not work

{{ voltService.getCompiler().getTemplatePath() }}

This will return the full path of the current template, you would probably want to create a filter/function in volt to parse it properly.