I have a problem setting render level for views in micro framework. For front page I want the the "default" render level, which is main layout > action view (I dont use controller layout). But for some ajax page I don't want to have any layout at all but still keep the view in the views directory.
$app->get('getVideo/{id}', function($id) use($app) { //the AJAX
$app['view']->setRenderLevel(\Phalcon\Mvc\View::LEVEL_NO_RENDER);
echo $app['view']->getRender('main','video'); //I want this to only load "video.phtml" not "views/index.phtml" then "video.phtml"
});
$app->get('/', function() use($app) {
header("Content-Type: text/html; charset=utf-8");
echo $app['view']->getRender('main','front');
});
It keeps loading the main layout inside the 'video.phtml' on getVideo. What can I do?