Skip to content

generic solution to injecting action parameters by type hint #10710

Closed
@lsmith77

Description

@lsmith77

Currently ControllerResolver is responsible for determining the parameters to pass to controller actions. It does so via Reflection matching request attribute names to action parameter names. For parameters using the Request type hint it however knows to inject the Request instance.

Now in FOSRestBundle we have a need to inject parameters by type hint. Which leads to having to do the same work again. See for example:
FriendsOfSymfony/FOSRestBundle#745

So it might make sense to provide some way to tell the ControllerResolver for whatever other type hints to look for and what attributes to map them to.

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