8000 Inject also query parameters as controller arguments · Issue #3254 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Inject also query parameters as controller arguments #3254
Closed
@Koc

Description

@Koc

There is some inconsistency now. For example I have route

    # app/config/routing.yml
    hello:
        pattern:      /hello/{name}
        defaults:     { _controller: AcmeHelloBundle:Hello:index }

and action

<?php

    public function indexAction($name)
    {
      // ...
    }

And after some time we want change route

    # app/config/routing.yml
    hello:
        pattern:      /hello/
        defaults:     { _controller: AcmeHelloBundle:Hello:index }

After this change urls will containe name as get parameter, this part is ok. But controller hasn't more argument $hello, so after changing in route I should go to each controllers and change also some code.

https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpKernel/Controller/ControllerResolver.php#L110

<?php

$attributes = array_merge($request->query->all(), $request->attributes->all());

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0