多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# Abstract class Phalcon\\Mvc\\Controller # Abstract class **Phalcon\\Mvc\\Controller** *extends* abstract class `Phalcon\Di\Injectable` *implements*[*Phalcon\\Events\\EventsAwareInterface*](#), `Phalcon\Di\InjectionAwareInterface`, [*Phalcon\\Mvc\\ControllerInterface*](#) 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. ``` <pre class="calibre14">``` <?php <?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** (*unknown* $dependencyInjector) inherited from Phalcon\\Di\\Injectable Sets the dependency injector public **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 **getEventsManager** () inherited from Phalcon\\Di\\Injectable Returns the internal event manager public **\_\_get** (*unknown* $propertyName) inherited from Phalcon\\Di\\Injectable Magic method \_\_get | - [索引](# "总目录") - [下一页](# "Class Phalcon\Mvc\Dispatcher") | - [上一页](# "Class Phalcon\Mvc\Collection\Manager") | - [API Indice](#) »