Skip to content

Instantly share code, notes, and snippets.

@Tocacar
Created May 23, 2016 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tocacar/44002997272409973984492820262f43 to your computer and use it in GitHub Desktop.
Save Tocacar/44002997272409973984492820262f43 to your computer and use it in GitHub Desktop.
//sf2 method injection
ams.base_task_manager:
class: '%base_task_manager.class%'
calls:
- [setEntityManager, ["@doctrine.orm.entity_manager"]]
- [setUserManager, ["@ams.user_manager"]]
- [setTemplating, ["@templating"]]
- [setFormFactory, ["@form.factory"]]
//Slim constructor injection
$container['MyController'] = function ($c) {
$dbService = $c->get('DatabaseService');
return new MyController($dbService);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment