Created
November 4, 2013 19:55
-
-
Save ppeiris/7308289 to your computer and use it in GitHub Desktop.
This file contains 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 yourclass implements ServiceLocatorAwareInterface | |
{ | |
protected $serviceLocator; | |
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) | |
{ | |
$this->serviceLocator = $serviceLocator; | |
} | |
public function getServiceLocator() | |
{ | |
return $this->serviceLocator; | |
} | |
public function somefunction(){ | |
$config = $this->getServiceLocator()->get('config'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment