I'm following the symblog tutorial right now, using Symfony 2.2.2
2.3 has some breaking changes, so I'm using 2.2 to get info on deprecated functions. But to the problem:
After having created the comment form, I got an error saying no route was found for the GET comment:new controller.
That appeared to be an update in Twig, where the following code used to work:
{% render 'BloggerBlogBundle:Comment:new' with { 'blog_id': blog.id } %}
You must now use:
{% render controller('BloggerBlogBundle:Comment:new') with { 'blog_id': blog.id } %}
After that, I got another error, stating the following:
Controller "Blogger\BlogBundle\Controller\CommentController::newAction()" requires that you provide a value for the "$blog_id" argument (because there is no default value or because there is a non optional argument after this one).
As far as I'm aware, with { 'blog_id': blog.id }
should pass that argument along. But it's not.
The comments for the tutorial are extensive, but nothing mentions this. And I'm not very familiar with twig and symfony, I don't know where else to look for the problem.
EDIT: to be clear, I am calling this controller function from within an already existing twig file, not from inside a PHP file. No route has been defined for it. The action will then call another twig file to include the form element to the page. The tutorial explains this is so the form can be re-used on various parts of the site, removing the need to make a large amount of form elements which basically all do the same thing.