我正在使用Symfony2,並且我有一個ReaderBundle,它有一個Rss實體。symfony2 crud&http cache
我爲此實體創建了CRUD。
php app/console generate:doctrine:crud --entity=RSSReaderBundle:Rss --format=annotation --with-write
在連接Cache之前,一切都很好。
$loader = require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppCache.php';
require_once __DIR__.'/../app/AppKernel.php';
Debug::enable();
$kernel = new AppKernel('dev' , true);
$kernel->loadClassCache();
$kernel = new AppCache($kernel); // THAT STRING IS MAIN PROBLEM
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
然後當我試圖刪除一些記錄,我把這個錯誤: No route found for "POST /rss/delete/30": Method Not Allowed (Allow: DELETE)
我創建了一個表格,清楚地表明,該方法:
405 Method Not Allowed
private function createDeleteForm($id)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('rss_delete', array('id' => $id)))
->setMethod("DELETE")
->add('submit', 'submit', array('label' => 'Delete'))
->getForm()
;
}
我沒有發現問題。請幫助
連接緩存之前,一切都很好。當我評論$內核=新的AppCache($內核);刪除功能的作品 –