Abstract class Phalcon\Mvc\Controller

extends abstract class Phalcon\Di\Injectable

implements Phalcon\Events\EventsAwareInterface, Phalcon\Di\InjectionAwareInterface

Every application controller should extend this class that encapsulates all the controller functionality The controllers provide the “flow” between models and views. Controllers are responsible for processing the incoming requests from the web browser, interrogating the models for data, and passing that data on to the views for presentation.

  1. <?php
  2. <?php
  3. class PeopleController extends \Phalcon\Mvc\Controller
  4. {
  5. //This action will be executed by default
  6. public function indexAction()
  7. {
  8. }
  9. public function findAction()
  10. {
  11. }
  12. public function saveAction()
  13. {
  14. //Forwards flow to the index action
  15. return $this->dispatcher->forward(array('controller' => 'people', 'action' => 'index'));
  16. }
  17. }

Methods

final public __construct ()

Phalcon\Mvc\Controller constructor

public setDI (unknown $dependencyInjector) inherited from Phalcon\Di\Injectable

Sets the dependency injector

public Phalcon\DiInterface getDI () inherited from Phalcon\Di\Injectable

Returns the internal dependency injector

public setEventsManager (unknown $eventsManager) inherited from Phalcon\Di\Injectable

Sets the event manager

public Phalcon\Events\ManagerInterface getEventsManager () inherited from Phalcon\Di\Injectable

Returns the internal event manager

public __get (unknown $propertyName) inherited from Phalcon\Di\Injectable

Magic method __get