8000 Can not pass variable to a Action from render function when using esi · Issue #6788 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

Can not pass variable to a Action from render function when using esi #6788

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
scourgen opened this issue Jan 18, 2013 · 2 comments
Closed

Comments

@scourgen
Copy link
Contributor

in my twig:

{% render url("esi_right",{'title' : 'b'}) with { },{ 'standalone': true } %}

in my controller:

    /**
     * @Template("MyWebBundle:_Layout:widget/right.html.twig")
     * @Cache(expires="+1 hour", smaxage=3600, maxage=3600)
     * @Route("esi/right",name="esi_right")
     */
    public function rightAction($line = null, $title='a')
    {
        echo ($title);

$title is still 'a'

I know that by using esi,the partial of a page will be a url instead, and the only way to pass variable to a url is by url(get) or post. but I still don't know that's for sure or not.

@stof
Copy link
Member
stof commented Jan 18, 2013

Well, this is logical. You are generating the url for your esi_right route, but this route does not have a placeholder for title, so it won't be found when matching the route again

@Tobion
Copy link
Contributor
Tobion commented Jan 18, 2013

or you can use $request->query->get('title')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0