没有工作,我有我的路线“/
”默认控制器设置为运行指标:的Symfony2与FOSUserBundle - 重定向在控制器
public function indexAction() {
if ($this->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY')) {
//render the logged in view(s)
$response = $this->render('Pan100MoodLogBundle:Default:index.html.twig');
} else {
//redirect to the login controller
$response = $this->redirect($this->generateUrl('login'));
}
return $response;
}
但是Symfony的找不到路线:
路线“登录“不存在。 500内部服务器错误 - RouteNotFoundException
什么可能是错误的?我正在使用FOSUserBundle。
你的意思是布局? – Piddien 2013-03-04 16:45:11
我把它放在我的配置/路由中,它不起作用。它的工作原理与我在答案中描述的一样,但我不知道这是否是正确的做法... – Piddien 2013-03-04 16:53:06