我想用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