We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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????



16.0k
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