私が得ている完全なエラーはこれです。
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' %}
{% block body %}
{{ blog.title }}<br/>
{{ blog.author }}<br/>
{{ blog.blog }}<br/>
{{ blog.tags }}<br/>
{{ blog.comments }}
{% endblock %}
上記のテンプレートは、次の場所にあるviews/article/
別のテンプレートを拡張したものにviews/
あります。
{% extends 'FooBlogBundle::layout.html.twig' %}