2012-07-30 95 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