Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

how to automatically "rebuild" template files?

Right now I need to delete my base template and others (the .php file generated by Volt) every time I made some change in my editor.

How can I automate this process via dependency injection or something else, so the rebuilding is done every time on every page reload/refresh in the browser?

I hope there is some solution, because it's nice that is cached in the final app, but during the development I need to see the cahnges straight ahead and not only after I delete the base.phtml.php.

Btw. this is my code in the boostrap file:

 //Setup the view component
    $di->set('view', function(){
        $view = new \Phalcon\Mvc\View();
            ".phtml" => 'Phalcon\Mvc\View\Engine\Volt'
        return $view;

edited Mar '14

Take a look at compileAlways option (true\false, i put it into config to have different variants on different environments)

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

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

                'compiledPath' => $config->application->cacheVoltDir,
                'compiledSeparator' => '_',
                'compileAlways' => $config->application->alwaysRecompileView

            return $volt;
        '.phtml' => 'Phalcon\Mvc\View\Engine\Php'