From the sparse documentation I have understood that beforeExecuteRoute
prevents action being executed, that works. However I would expect that the associated view won't be rendered too, though the foollowing code will result into rendering it, why? What is the point of it?
<?php
use Phalcon\Mvc\Dispatcher,
Phalcon\Mvc\View;
class TestController extends \Phalcon\Mvc\Controller {
public function beforeExecuteRoute(Dispatcher $dispatcher)
{
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
// refuse non-Ajax requests
if (!$this->request->isAjax()) {
bdump('prevented');
return false;
}
return true;
}
public function fooAction()
{
bdump('foo action');
}
}