2012-07-30 92 views
0

我需要一些幫助,因爲我沒有成功找到我的路由問題的來源。Symfony 2 - 找不到「GET/videotheque」的路由

這裏是我的routing.yml

gstyle39VideothequeBundle: 
    resource: "@gstyle39VideothequeBundle/Resources/config/routing.yml" 
    prefix: /videotheque 

routing.ymlVideothequeBundle/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 ...

+0

因爲'路由器:debug'在輸出時,您必須在網址的末尾添加斜線。 – gilden 2012-07-30 09:27:05

+0

你是否錯過了結尾'/'?你的路線應該是'http:// yourpage.local/videotheque /'(記住結尾的斜線)。 – Sgoettschkes 2012-07-30 09:27:10

+0

我已經測試,但錯誤仍然在這裏 – 2012-07-30 09:48:06

回答

0

恕我直言,你沒有在應用程序全局的routing.yml(應用程序/配置/ routing.yml中)添加路由定義。

看看我的路由定義在https://github.com/drupalmk/Jobeeto

+0

嗨,我添加了路由定義,但錯誤再次出現 – 2012-07-30 13:09:16

+0

你是否提供了你所有的配置? – drupality 2012-07-30 13:17:56

+0

btw嘗試http://yourpage.local/app_dev.php/videotheque/ – drupality 2012-07-30 13:18:39