Skip to content

Instantly share code, notes, and snippets.

@mnapoli
Last active December 19, 2015 04:49
Show Gist options
  • Save mnapoli/5900314 to your computer and use it in GitHub Desktop.
Save mnapoli/5900314 to your computer and use it in GitHub Desktop.
Controller as services with Property Injection
<?php
class UserController
{
/**
* @Inject
* @var RouterInterface
*/
private $router;
/**
* @Inject
* @var FormFactoryInterface
*/
private $formFactory;
public function createForm($type, $data, $options)
{
// $this->formFactory->...
}
}
@mnapoli
Copy link
Author

mnapoli commented Jul 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment