Skip to content

Instantly share code, notes, and snippets.

@ppeiris
Created November 4, 2013 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ppeiris/7308289 to your computer and use it in GitHub Desktop.
Save ppeiris/7308289 to your computer and use it in GitHub Desktop.
<?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