搜索
查看: 1277|回复: 0

Zend Framework教程之Zend_Controller_Plugin插件用法详解

[复制链接]

4856

主题

4856

帖子

4861

积分

新手上路

Rank: 1

积分
4861
发表于 2018-2-11 12:15:27 | 显示全部楼层 |阅读模式

            本文实例讲述了Zend Framework教程之Zend_Controller_Plugin插件用法。分享给大家供大家参考,具体如下:
通过Zend_Controller_Plugin可以向前端控制器增加附加的功能。便于w一些特殊功能。以下是Zend_Controller_Plugin的简单介绍。
Zend_Controller_Plugin的基本实现
├── Plugin
│   ├── Abstract.php
│   ├── ActionStack.php
│   ├── Broker.php
│   ├── ErrorHandler.php
│   └── PutHandler.php
Zend_Controller_Plugin_Abstract
abstract class Zend_Controller_Plugin_Abstract
{
protected $_request;
protected $_response;
public function setRequest(Zend_Controller_Request_Abstract $request)
{
  $this->_request = $request;
  return $this;
}
public function getRequest()
{
  return $this->_request;
}
public function setResponse(Zend_Controller_Response_Abstract $response)
{
  $this->_response = $response;
  return $this;
}
public function getResponse()
{
  return $this->_response;
}
/**
  * Called before Zend_Controller_Front begins evaluating the
  * request against its routes.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @return void
  */
public function routeStartup(Zend_Controller_Request_Abstract $request)
{}
/**
  * Called after Zend_Controller_Router exits.
  *
  * Called after Zend_Controller_Front exits from the router.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @return void
  */
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{}
/**
  * Called before Zend_Controller_Front enters its dispatch loop.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @return void
  */
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{}
/**
  * Called before an action is dispatched by Zend_Controller_Dispatcher.
  *
  * This callback allows for proxy or filter behavior. By altering the
  * request and resetting its dispatched flag (via
  * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  * the current action may be skipped.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @return void
  */
public function preDispatch(Zend_Controller_Request_Abstract $request)
{}
/**
  * Called after an action is dispatched by Zend_Controller_Dispatcher.
  *
  * This callback allows for proxy or filter behavior. By altering the
  * request and resetting its dispatched flag (via
  * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
  * a new action may be specified for dispatching.
  *
  * @param Zend_Controller_Request_Abstract $request
  * @return void
  */
public function postDispatch(Zend_Controller_Request_Abstract $request)
{}
/**
  * Called before Zend_Controller_Front exits its dispatch loop.
  *
  * @return void
  */
public function dispatchLoopShutdown()
{}
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

长春门户网站

长春门户网是网民了解长春的网络窗口,同是提供长春地区百姓生活分类供求信息的门户网站,同时提供长春网站建设、长春网站设计,我们将逐步的完善网站分类信息资源;

长春门户网二维码

联系我们

  • 工作时间:早上8:00 - 晚上5:30
  • 投稿联系:13624467185(微信同号)
  • 反馈邮箱:5053050@QQ.com
  • 公司地址:吉林省长春市亚泰大街与自由大路交汇五环国际大厦1408室

QQ|小黑屋|手机版|Archiver|CCZCC! ( 吉ICP备2021009740号-8 )

Powered by Discuz! X3.4 © 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表