Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Resource parameters not attached to ResourceEvent on custom ResourceController class #118

@Wilt

Description

@Wilt

If I register a custom ResourceController class in the config using the controller_class parameter I run into the problem that the resource parameters are not available in the ResourceEvent in my listeners. The parameters are injected on dispatch by ResourceParameterListener but only attached to PhlyRestfully\ResourceController: https://github.com/phly/PhlyRestfully/blob/master/src/PhlyRestfully/Listener/ResourceParametersListener.php#L57
Is this expected behaviour? How do I get the parameters in my custom controller? Should I register my own custom version of ResourceParameterListener in config.php? Some advice on how to do this would be great.

UPDATE:
It also works if I set the event identifier for my controller in the resources configuration to: 'identifier' => 'PhlyRestfully\ResourceController'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions