1
如何扩展Zend_Controller_Request_Http,让应用程序知道My_Controller_Request_Http?如何扩展Zend_Controller_Request_Http
解决方案
这是我如何得到它的工作如下戈登三分球。
Firts保存以下文件资料库:我的/控制器/申请/ Http.php
<?php
class My_Controller_Request_Http extends Zend_Controller_Request_Http {
/* Add all your custom functions here */
}
在引导类添加以下。
function _initApplication()
{
/* Doing some other stuff here */
$this->bootstrap('frontcontroller');
$front = $this->getResource('frontcontroller');
$front->setRequest('My_Controller_Request_Http');
/* Registering some plugins here, not relevant */
}
谢谢戈登! – Phliplip 2010-08-23 12:26:58