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

Volt compiled file name

Can I change name of compiled files? In docs i find how to change separator of compiled files path , but that's not what I need. Currently in result I have file name like

/home/mitris/www/invo/cache/volt/%%home%%mitris%%www%%invo%%app%%views%%about%%index.volt.php

4 days ago on blog.phalcon.io, it is for 1.2.0

// Just append the .php extension to the template path
$volt->setOptions([
    'compiledPath' => function($templatePath) {     
            return $templatePath . '.php';
    }
]);

// ​ ​Recursively create the same structure in another directory
$volt->setOptions([
        'compiledPath' => function($templatePath) {
               $dirName = dirname($templatePath);
               if (!is_dir(CACHE_DIR . $dirName)) {
                      mkdir(CACHE_DIR . $dirName);
               }
               return CACHE_DIR . $dirName;
    }
]);