Skip to content

Instantly share code, notes, and snippets.

@robertbasic
Created October 26, 2012 07:43
Show Gist options
  • Select an option

  • Save robertbasic/3957469 to your computer and use it in GitHub Desktop.

Select an option

Save robertbasic/3957469 to your computer and use it in GitHub Desktop.
<?php
namespace HexCommon\View\Helper;
use Zend\View\Helper\AbstractHelper;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
/**
* An abstract view helper, to be implemented by view helpers
* that need to be ServiceLocatorAware
*/
abstract class ServiceLocatorAwareHelper extends AbstractHelper implements ServiceLocatorAwareInterface
{
/**
* Set the service locator.
*
* @param ServiceLocatorInterface $serviceLocator
* @return AbstractHelper
*/
public function setServiceLocator(ServiceLocatorInterface $serviceLocator)
{
$this->serviceLocator = $serviceLocator;
return $this;
}
/**
* Get the service locator.
*
* @return \Zend\ServiceManager\ServiceLocatorInterface
*/
public function getServiceLocator()
{
return $this->serviceLocator;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment