Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

why return false in action could not render views in 2.0 and it will in 1.3.4

phalcon version 1.3.4

public function loginAction()
{
    if(!$this->request->isPost()) return false;   // it will render login.phtml
}

phalcon version 2.0

public function loginAction()
{
    if(!$this->request->isPost()) return false;   // it could not render login.phtml , when i use return true ,it can
}

why????



12.3k
Accepted
answer

I don't think there is a need to return false or true in any case. A simple 'return;' to end the action execution is enough and will work with both 1.3.x and 2.0.x