I'm struggling on lack of doc issue on view and controller details about Phalcon,
what I'm doing in index.php is like,
$viewCollections = new MicroCollection() ;
$viewCollections->setHandler('BackenduiController',true) ;
$viewCollections->get('/main/index', 'index');
$app->mount($viewCollections) ;
In my controller,
<?php
use Phalcon\Mvc\View;
class BackenduiController extends ControllerBase
{
public function initialize()
{
}
public function index()
{
$this->tag->setTitle('A | B');
$this->view->setTemplateAfter('nav') ;
$this->view->render(
"main","index"
);
}
}
My view volt file structure is like,
views
--layouts
----index.volt
----nav.volt
--main
----index.volt
--index.volt
the nav.volt is just a nav bar piece of html code, my purpose is to insert the nav bar code in the main/index page, however if I use setTemplateAfter, the result page is only the nav piece of code, not showing the index page at all. So How should I arrange the code to make the controller rendering the correct page?