【发布时间】:2012-07-30 09:23:58
【问题描述】:
我需要一些帮助,因为我没有成功找到路线问题的根源。
这是我的routing.yml:
gstyle39VideothequeBundle:
resource: "@gstyle39VideothequeBundle/Resources/config/routing.yml"
prefix: /videotheque
VideothequeBundle/Resources/config/ 中的routing.yml:
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");
}
}
就我而言,我做了一个“cache:clear”,一个检测到我的路由的“router:debug”:
VideothequeBundle_homepage ANY /videotheque/
我还手动删除了文件夹app/cache...
【问题讨论】:
-
当
router:debug正在输出时,您必须在您的网址末尾附加一个斜杠。 -
你错过了结尾
/吗?你的路线应该是http://yourpage.local/videotheque/(注意结尾的斜线)。 -
我已经测试过,但错误仍然在这里