I want to load a partial view in Phalcon based on the route parameter.
I have this action, which determines the name of the partial:
public function addAction($discipline = null)
{
if (isset($discipline)) {
$this->view->partial = 'add' . $discipline . '.phtml';
} else {
$this->view->partial = 'addstatic.phtml';
}
}
And in the main view, I want to load this partial with the Volt-command partial
, like so:
{{ partial('partials/training/' ~ partial) }}
But I am facing this error:
View 'C:\xampp\htdocs\apneist_social/app/views/partials/training/addstatic.phtml' was not found in the views directory
If I browse to this file with the directory browser, I can find the file though.
Remove the extension (.phtml). Like:
$this->view->partial = 'addstatic';