Skip to content

_format parameter is ignored in twig render function #8787

@davefx

Description

@davefx

This is related to the old issue #2653, that has returned after Symfony 2.3.

(In this example I've just added code to the AcmeDemoBundle to make it easier to reproduce):

Twig code added to AcmeDemoShopBundle:Demo:index.html.twig:
{{ render (controller('AcmeDemoBundle:Demo:hello2', {'_format' : 'otherformat'})) }}

Controller code added to Acme\DemoBundle\Controller\DemoController:
/*
@route("/hello2.{_format}", name="_demo_hello2", defaults={"_format" = "defaultformat"})
@template()
*/
public function hello2Action($_format) {
return array('_format' => $_format);
}

When the Twig template calls the render function the _format parameter is ignored and the controller always see "html" instead 'otherformat' (specified in the render function).

The bug has been introduced in 2.3-dev after revision f03a489 (as this one still works, but last 2.3 doesn't)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions