Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added call method to the container. #116

Merged
merged 1 commit into from Nov 9, 2014
Merged

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
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@freost
Copy link
Member

@freost 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants