我想用zf 1.11配置Doctrine 2.2。一切都做,但我不知道这是什么错误大概是:严格标准:声明:: postDispatch()
Strict standards: Declaration of Sc\Resource\EntityManagerFront::postDispatch() should be compatible with that of Zend_Controller_Plugin_Abstract::postDispatch() in D:\xampp\htdocs\sc\library\Sc\Resource\EntityManagerFront.php on line 26
我的代码:
<?php
namespace Sc\Resource;
use Zend_Controller_Plugin_Abstract, Zend_Controller_Front;
class EntityManagerFront extends Zend_Controller_Plugin_Abstract
{
/**
* Flush the EntityManager.
*
* (non-PHPdoc)
* @see Zend_Controller_Plugin_Abstract::dispatchLoopShutdown()
*/
public function postDispatch($request)
{
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$em = $bootstrap->getResource('EntityManager');
$em->flush();
return $em;
}
}
捕获的致命错误:传递给钪\资源\ EntityManagerFront ::执行postDispatch(参数1)必须为Sc \资源\ Zend_Controller_Request_Abstract的Zend_Controller_Request_Http的实例给出的,称为d的一个实例:\ XAMPP \ htdocs中\ SC \ library \ Zend \ Controller \ Plugin \ Broker.php在第333行,并在第18行的D:\ xampp \ htdocs \ sc \ library \ Sc \ Resource \ EntityManagerFront.php中定义, – 2012-01-30 06:10:26
解决了这个问题:Zend_Controller_Request_Abstract – 2012-01-30 09:40:59