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

Add a context resource #134

Merged
merged 1 commit into from
Mar 9, 2014
Merged

Add a context resource #134

merged 1 commit into from
Mar 9, 2014

Conversation

bakura10
Copy link
Member

@bakura10 bakura10 commented Mar 8, 2014

ping @danizord @Ocramius

This is an attempt to solve #133 . I tried to make it as simple as possible and completely optional. Finally I decided not to automatically inject it into the controller method handlers, but rather only have a context method in the controller, so it can be used even in custom handlers.

Currently, the method is called getContextResource so you retrieve a ResourceInterface. I suppose the only use case is actually retrieving the context data (so $this->getContextResource()->getData()). Maybe it should be rename "getContextData"?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.56%) when pulling 43fa34d on prev-route-match into 31a6713 on master.

@bakura10
Copy link
Member Author

bakura10 commented Mar 9, 2014

Thanks. I'm merging then.

bakura10 added a commit that referenced this pull request Mar 9, 2014
@bakura10 bakura10 merged commit 47dbf7a into master Mar 9, 2014
@bakura10 bakura10 deleted the prev-route-match branch March 9, 2014 10:10
@danizord
Copy link
Contributor

danizord commented Mar 9, 2014

Great! $this->getContextResource()->getData(); looks fine to me. (metadata can be useful someday) 😉

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.

None yet

3 participants