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

Compiled files in Volt with large names

I had set a compiled folder for Volt, but now their compiled files name is INSANE. Here's an example:

%%var%%www%%gconves%%app%%vistas%%login%%index.phtml.compiled

Do you have any troubles with these names?



33.8k

No, but without setting a compiled folder the name is veeeeeeeery tiny compare to that. That's my concern.



33.8k
Accepted
answer
edited Aug '14

I solve it thanks to https://forum.phalcon.io/discussion/469/volt-compiled-file-name (here, $templatePath is $compiledTemplate, $dirName is $compiled)

"compiledPath" => function ($compiledTemplate) {
            // Here you take the file name.
            $compiled = substr($rutaCompilada, strripos($compiledTemplate, "/") + 1);

            // Here you add the path and extension you want.
             return "../app/views/compileds/" . $compiled . ".compiled";
}