No route found for "GET Comment:new""
Bonjour,
je suis entraint de suivre un tuto à l'adresse http://keiruaprod.fr/symblog-fr/docs...mentaires.html
Je suis à la fin de l'étape 4 mais j'ai une erreur à l'éxecution dont je ne trouve pas la solution.
Erreur :
Citation:
An exception has been thrown during the rendering of a template ("No route found for "GET Comment:new"") in BloggerBlogBundle:Blog:show.html.twig at line 25.
show.html.twig
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| {# src/Blogger/BlogBundle/Resouces/views/Blog/show.html.twig #}
{% extends 'BloggerBlogBundle::layout.html.twig' %}
{% block title %}{{ blog.title }}{% endblock %}
{% block body %}
<article class="blog">
<header>
<div class="date"><time datetime="{{ blog.created|date('c') }}">{{ blog.created|date('l, F j, Y') }}</time></div>
<h2>{{ blog.title }}</h2>
</header>
<img src="{{ asset(['images/', blog.image]|join) }}" alt="{{ blog.title }} image not found" class="large" />
<div>
<p>{{ blog.blog }}</p>
</div>
</article>
<section class="comments" id="comments">
<section class="previous-comments">
<h3>Comments</h3>
{% include 'BloggerBlogBundle:Comment:index.html.twig' with { 'comments': comments } %}
</section>
<h3>Add Comment</h3>
{% render 'BloggerBlogBundle:Comment:new' with { 'blog_id': blog.id } %}
</section>
{% endblock %} |
la partie du code qui pose problème est en gras
CommentController.php
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| class CommentController extends Controller
{
public function newAction($blog_id)
{
$blog = $this->getBlog($blog_id);
$comment = new Comment();
$comment->setBlog($blog);
$form = $this->createForm(new CommentType(), $comment);
return $this->render('BloggerBlogBundle:Comment:form.html.twig', array(
'comment' => $comment,
'form' => $form->createView()
));
} |
j'affiche seulement l'action new