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

I can't create controller in INVO

Hello. I'm trying to improve the demo website INVO of the tutorial 2. I tried to create a new controller called AlarmController.php. The view is 'index.volt' in the Folder 'alarm'. The result is nothing. I already set it in the SecurityPlugin. Anyone can do it? I have no problems adding controllers starting from 0, like in the first tutorial.



22.8k

Hi there, your action name on the controller should match the filename. example :

class AlarmController extends Phalcon\Mvc\Controller
{
    // this will render the view  /alarm/index.phtml by default OR the index.volt file.
    public function indexAction()
    {
        // you can also explicitly set the name of the view (file) you want to render
        // like this
        $this->view->pick('folderName/viewFileName'); 
    }
}


1.4k
Accepted
answer

Try deleting the cookies.