Documentation

目次

前のトピックへ

< Class Phalcon\Mvc\Collection\Manager

次のトピックへ

Class Phalcon\Mvc\Dispatcher >

このページ

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.

<?php

class PeopleController extends \Phalcon\Mvc\Controller
{

  //This action will be executed by default
  public function indexAction()
  {

  }

  public function findAction()
  {

  }

  public function saveAction()
  {
   //Forwards flow to the index action
   return $this->dispatcher->forward(array('controller' => 'people', 'action' => 'index'));
  }

}

Methods

final public __construct ()

Phalcon\Mvc\Controller constructor

public setDI (Phalcon\DiInterface $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 (Phalcon\Events\ManagerInterface $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 (string $propertyName) inherited from Phalcon\DI\Injectable

Magic method __get