Hi,
I've inherited an existing website based on phalcon and angularjs with volt view engine. So far I've been successful with fixing problems with existing pages, using the configuration set up by the previous devloper. But we have some new use cases that are out of the scope of the previous setup. I'm having trouble achieving what I want without break the old configuration.
I want to define a new main layout different from old main layout and render viewes with the new main layout. I have defined the new main layout in:
app/views/layouts/newLayout.volt
I have a the view I want to render inside the main layout in:
app/views/new/index.volt
I have a controller in:
app/controllers/NewController.php
Following is my controller code:
<?php
use Phalcon\Mvc\Controller;
use Phalcon\Mvc\View;
class NewController extends Controller
{
public function indexAction() {
$this->view->setLayoutsDir('layouts/');
$this->view->setLayout('newLayout');
$this->view->pick("new/index");
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
}
}
?>
This is as close as I can get it to work. The layout however is not picked up. Only the contents of new/index.volt is rendered. Please help!!