This article describes the usage of Zend Framework distributor. Share it for your reference, as follows:
Distribution is the entire process of obtaining the request object, extracting the module name, controller name, action name and optional parameters, and then instantiating the controller and calling the action in it.
If the module, controller, or action is not found, the default value will be used.
The Zend_Controller_Dispatcher_Standard class specifies that the default value of each controller and action is index, and the default value of the module is default.
This class allows developers to change the default value settings through the setDEfaultController() method, the setDefaultAction() method and the setDefaultModule() method.
_forward()
Function:Call this method in any action and pass in the action, controller, module and optional parameters to enter a new action.
Case:
<?php public function fooAction(){ //Define the action //Go to the current controller and other actions in the module $this->_forward('bar',null,null,array('baz'=>'bogus'));//The first parameter is the table action; the second parameter is the table controller; the third parameter is the module} public function barAction(){ //Define the action //Go to the action of other controllers of the current module, FooController::bazAction() $this->_forward('baz','foo',null,array('baz'=>'bogus')); } public function bazAction(){ //Go to other controllers and actions in other modules, Foo_BarController::bazAction() $this->_forward('baz','bar','foo',array('baz'=>'bogus')); }
For more information about Zend, please visit the special topic of this site:Zend FrameWork Framework Introduction Tutorial》、《Summary of excellent development framework for php》、《Yii framework introduction and common techniques summary》、《ThinkPHP Introduction Tutorial》、《PHP object-oriented programming tutorial》、《PHP+mysql database operation tutorial"and"Summary of common database operation techniques for php》
I hope that this article will be helpful to everyone's PHP programming based on the Zend Framework framework.