전체 오류가 발생했습니다. Symfony, 오류 : 렌더링 도중 예외가 발생했습니다.
An exception has been thrown during the rendering of a template ("Some mandatory parameters are missing ("id") to generate a URL for route "FooBlogBundle_articles".") in "FooBlogBundle:Article:articles.html.twig".
이
이 작업을 처리하는 컨트롤러입니다 :public function articlesAction($id)
{
$em = $this->getDoctrine()->getManager();
$blog = $em->getRepository('FooBlogBundle:Blog')->find($id);
if(!$em){
throw $this->createNotFoundException('Unable to find blog posti');
}
return $this->render('FooBlogBundle:Article:articles.html.twig', ['blog'=>$blog]);
}
}
과
FlickBlogBundle_articles:
pattern: /foo/{id}
defaults: { _controller: FooBlogBundle:Article:articles }
requirements:
_method: GET
id: \d+
나뭇 가지와 데이터베이스를 라우팅, 어떤 유형이나 문제가 완전히 정상입니다. 그러나이 오류는 내가 잘못한 곳에서 발견하기가 어렵습니다.
편집 : 그냥
{% extends 'FooBlogBundle::layout.html.twig' %}
안녕, 난 것이다 이 althouh 시도, 어떻게 잘 모르겠지만, 관련된 템플릿을 포함하도록 내 질문을 업데이트했습니다. – ANW
'FooBlogBundle :: layout.html.twig'에있을 수 있습니까? 'FlickBlogBundle_articles' 링크를 생성 한 곳을 검색하십시오. –
이 튜토리얼 http://tutorial.symblog.co.uk/docs/doctrine-2-the-blog-model.html을 따르고 있습니다. 그리고 정확히 거기에 표시된대로 만들었습니다. 메뉴 및 양식 리디렉션을 제외하고 데이터를 생성하는 템플릿에 대해 언급 한'path()'메서드를 찾을 수 없습니다. – ANW