에서 작동하지 않는 인덱스를 실행하도록 설정 :이 FOSUserBundle와 Symfony2 재 내가 경로 "<code>/</code>"내 기본 컨트롤러가 컨트롤러
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;
}
그러나 심포니는 경로를 찾을 수 없습니다 :
경로를 " 로그인 "이 존재하지 않습니다. 500 내부 서버 오류 - RouteNotFoundException
무엇이 잘못 될 수 있습니까? FOSUserBundle을 사용하고 있습니다. 그것은처럼 보이는 fos_user_security_login
$response = $this->redirect($this->generateUrl('fos_user_security_login'));
시도? – Piddien
이것을 config/routing에 넣었지만 작동하지 않았습니다. 내 대답에 묘사 된 방식대로 작동하지만 올바른 일이 아닌지 잘 모르겠다. – Piddien