We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Volt and phtml as view in same Phalcon project

I am currently using phalcon framework. I want to ask is it possible to use .volt and .phtml file extensions for my views in a same project. In my services.php file view component is set with this code:

$di->set('view', function() use ($config) {

$view = new View();


    '.volt' => function($view, $di) use ($config) {

        $volt = new VoltEngine($view, $di);

        'compiledPath' => $config->application->cacheDir .                      
            'compiledSeparator' => '_'

        return $volt;

return $view;

}, true);

If is possible to write it so it opens .volt view files, as .phtml files, because I need to add some jQuery and Ajax in a view, and i it won't work in .volt.

What do you mean it won't work in Volt? Do you mean it won't render on the page, won't highlight/autocomplete in your IDE, or there are errors.


now is ok, but I have problem when i use jquery-ui, it won't work. for example if i write $('#string').dialog(); it's not working

Hmm. Might not even be a Volt issue. Could you provide your code please?