我需要一些幫助,因爲我沒有成功找到我的路由問題的來源。Symfony 2 - 找不到「GET/videotheque」的路由
這裏是我的routing.yml
:
gstyle39VideothequeBundle:
resource: "@gstyle39VideothequeBundle/Resources/config/routing.yml"
prefix: /videotheque
的routing.yml
在VideothequeBundle/Resources/config/
:
VideothequeBundle_homepage:
pattern:/
defaults: { _controller: gstyle39VideothequeBundle:Videotheque:index }
我的控制器:
<?php
namespace gstyle39\VideothequeBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpFoundation\Response;
class VideothequeController extends Controller
{
public function indexAction()
{
return new Response("Kikoo");
}
}
至於我,我做了一個 「緩存:明確」,一個「路由器:調試」,它檢測到我的路線:
VideothequeBundle_homepage ANY /videotheque/
我也手動刪除該文件夾app/cache
...
因爲'路由器:debug'在輸出時,您必須在網址的末尾添加斜線。 – gilden 2012-07-30 09:27:05
你是否錯過了結尾'/'?你的路線應該是'http:// yourpage.local/videotheque /'(記住結尾的斜線)。 – Sgoettschkes 2012-07-30 09:27:10
我已經測試,但錯誤仍然在這裏 – 2012-07-30 09:48:06