Created
November 6, 2012 22:35
-
-
Save mkpeacock/4028132 to your computer and use it in GitHub Desktop.
Custom paramaters to objects contained within pimple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $pimple = new Pimple(); | |
| $pimple['some_key'] = $pimple->protect(function($a, $b, $c) use ($pimple) { | |
| return new \MyVendor\MyComponent\MyObject($a,$b,$c, $pimple); | |
| }); | |
| $some_object = $pimple['some_key'](1,2,3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment