Last active
December 19, 2015 04:49
-
-
Save mnapoli/5900314 to your computer and use it in GitHub Desktop.
Controller as services with Property Injection
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
<?php | |
class UserController | |
{ | |
/** | |
* @Inject | |
* @var RouterInterface | |
*/ | |
private $router; | |
/** | |
* @Inject | |
* @var FormFactoryInterface | |
*/ | |
private $formFactory; | |
public function createForm($type, $data, $options) | |
{ | |
// $this->formFactory->... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Read the article here: http://en.mnapoli.fr/controllers-as-services/