Skip to content

[Proposal] Controllers have the current request as a property #248

Closed
@kapv89

Description

@kapv89

I know its a bit far off, but currently controllers derive their state via the callAction method. That means that the code beign written in the action cannot be stateless .. ie, all the actions, when called directly, in a newly 'composed' controller, need a global state.

This issue can be easily resolved by the controller having a request and response property in the controller.
The actions read from request and modify the response.
So the closure that the router forms for wrapping a controller action can just instantiate the controller with the current request, let the controller process the response, and then just return it .. what say ?

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