You can extend the compiler with a function to render a partial as "raw". This is what I use:
view service
$volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
$volt->setOptions(array(
'compiledPath' => __DIR__ . '/cache/',
'compiledExtension' => '.php',
'stat' => ( DEV ) ? true : false ,
'compiledSeparator' => '_',
'prefix' => 'compiled'
));
$compiler = $volt->getCompiler();
$compiler->addFunction('include_raw', function($resolvedArgs, $exprArgs) use ($view) {
return sprintf('file_get_contents("%s" . %s)', $view->getViewsDir(), $resolvedArgs);
});
return $volt;
template
<div class="container">
{{ include_raw('index/index.volt') }}
</div>