|
本文实例讲述了Zend Framework教程之分发器Zend_Controller_Dispatcher用法。分享给大家供大家参考,具体如下:
分发器的具体实现
Zend Framework的分发器Zend_Controller_Dispatcher设计主要有,如下类和接口组成:
├── Dispatcher
│ ├── Abstract.php
│ ├── Exception.php
│ ├── Interface.php
│ └── Standard.php
Zend_Controller_Dispatcher_Interface
定义了分发器提供的基本和标准功能。
interface Zend_Controller_Dispatcher_Interface
{
public function formatControllerName($unformatted);
public function formatModuleName($unformatted);
public function formatActionName($unformatted);
public function isDispatchable(Zend_Controller_Request_Abstract $request);
public function setParam($name, $value);
public function setParams(array $params);
public function getParam($name);
public function getParams();
public function clearParams($name = null);
public function setResponse(Zend_Controller_Response_Abstract $response = null);
public function getResponse();
public function addControllerDirectory($path, $args = null);
public function setControllerDirectory($path);
public function getControllerDirectory();
public function dispatch(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response);
public function isValidModule($module);
public function getDefaultModule();
public function getDefaultControllerName();
public function getDefaultAction();
}
|
|