I'm programming an admin web ui for a online system, I managed to mount a url to the view using,
$app->get(
"/main/index",
function () use ($app){
//no echo here
$app["view"]->render(
"main","index"
);
}
);
And my Main controller is like,
<?php
class MainController extends ControllerBase
{
public function initialize()
{
$this->tag->setTitle('Home Page');
$this->view->setTemplateAfter('nav');
}
public function indexAction()
{
}
}
My view structure is like,
views
--layouts
----index.volt
----nav.volt
--main
----index.volt
--index.volt
My problem is no matter how I change the MainController code, it doesn't affect anything on the rendered view main,index
. So I wish to know what's wrong here?
All I wanted is just for all my pages, there can be a nav bar showing, the nav bar code should be in nav.volt file. However this is not working.