#17368·cphalcon

[NFR]: Volt include with/without extension .volt

Author: fvromeraCreated Jul 17, 2026Updated Sep 18, 2026
Labelsnew feature request7.0

There is a little inconsistency in Volt when using include:

Using params:

If you are using params, you must to write without ending .volt, if not you get: View 'my-template.volt' was not found in any of the views directory

Ok: {% include 'my-template' with ['param': 1444 ] %} Wrong: {% include 'my-template.volt' with ['param': 1444 ] %}

Using dynamic template name:

If you are using dynamic template name, you must to write without ending .volt, if not you get: View theme ~ 'my-template.volt' was not found in any of the views directory

Ok: {% include theme ~ 'my-template' %} Wrong: {% include theme ~ 'my-template.volt' %}

Using static template name without params:

If you are using static template name without params, is the unique case you must to write with ending .volt, if not you get: Template file /path/to/my-template does not exist

Ok: {% include 'my-template.volt' %} Wrong: {% include 'my-template' %}

I think it should always work the same way. When you define in view which engines are active, you are indicating all extensions supported by them and which engine parse each one:

$view->registerEngines([
               '.my-html' => \CustomEngine::class,
                '.phtml'   => Php::class,
                '.volt'   => Volt::class,
]);

May be, to not break anything and create backward incompatibilities, its most interesting to accept adding .volt in dynamic template name or passing params, if don't write ending .volt, it accepts as today, but if you pass .volt accept too?