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

Parent class in Phalcon

how can one parse a parent method to the dispatcher in phalcon

if ($user != false) { $this->flash->success('Welcome ' . $user->username); $this->_registerSession($user); return $this->dispatcher->forward( array( 'controller' => 'login', 'action' => "parent::index" )); }

Uh... what?

Can you explain your problem more fully?

Im guessing he has controller extending other controller and he wants to call index action of parent controller ? Calling just index action should work fine.



79.0k
Accepted
answer

Calling just index action should work fine.

Unless he has same action name already defined in a child controller.

Just dispatch to the BaseController and action name defined in it.

You Are totally right, I was trying to call the index method of the base class. But I kept on getting errors.

Thank you all I have it fixed now with the answer @stamster gave