How can be disabled layout rendering?
For a moment i can detect that request is made via jQuery this way:
public function initialize()
{
if (!$this->request->isAjax()) {
// disable layout here... how?
}
}
Could it be done globally?
Code for handling ajax requests will be the same for all controlles, is there a way to define this behaviour rule globally for whole application?
public function initialize()
{
if (!$this->request->isAjax())
{
// disable layout here... how?
$this->view->setRenderLevel(\Phalcon\Mvc\View::LEVEL_ACTION_VIEW);
}
}
Also you could disable the auto rendering by calling
$this->view->disable();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With