Skip to content

Instantly share code, notes, and snippets.

@mkpeacock
Created November 6, 2012 22:35
Show Gist options
  • Select an option

  • Save mkpeacock/4028132 to your computer and use it in GitHub Desktop.

Select an option

Save mkpeacock/4028132 to your computer and use it in GitHub Desktop.
Custom paramaters to objects contained within pimple
$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