Skip to content

Conversation

@letr0n
Copy link
Contributor

@letr0n letr0n commented Nov 8, 2014

Ok as promised here's the second pull request for the container class. 100% backwards compatible and tested.

The new call method allows you to execute a callable and inject its dependencies using the container.

I have a third pull request that I'm working on but its a bit bigger so I'll probably wait until tomorrow since its getting pretty late here. I have a working prototype but I want to go through the code and write some more tests for it.

What I'm working on is making the route dispatcher execute the action using the Container::call method. This will enable us to inject dependencies directly into the rote controller methods and/or closures. We're converting some Silex applications to Mako and its a pretty useful feature that they have.

It would also be nice to do the same for task actions and possibly migrations as well.

The call method allows you to execute a callable and inject its
dependencies using the container.
freost added a commit that referenced this pull request Nov 9, 2014
Added call method to the container.
@freost freost merged commit c255801 into mako-framework:master Nov 9, 2014
@freost
Copy link
Member

freost commented Nov 9, 2014

Nice addition to the container :)

Executing route actions through the container sounds like a useful feature. It'll make it possible to inject common dependencies through the constructor while specific dependencies are injected into the method/closure that actually need them.

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

Successfully merging this pull request may close these issues.

2 participants