我需要一些帮助,因为我没有成功找到我的路由问题的来源。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