Created
November 4, 2012 14:08
-
-
Save eminetto/4012071 to your computer and use it in GitHub Desktop.
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 | |
namespace Core\View\Helper; | |
use Zend\View\Helper\AbstractHelper; | |
use Zend\ServiceManager\ServiceLocatorAwareInterface; | |
use Zend\ServiceManager\ServiceLocatorInterface; | |
/** | |
* Helper que inclui a sessão nas views | |
* | |
* @category Application | |
* @package View\Helper | |
* @author Elton Minetto <[email protected]> | |
*/ | |
class Session extends AbstractHelper implements ServiceLocatorAwareInterface | |
{ | |
/** | |
* Set the service locator. | |
* | |
* @param ServiceLocatorInterface $serviceLocator | |
* @return CustomHelper | |
*/ | |
public function setServiceLocator(ServiceLocatorInterface $serviceLocator) | |
{ | |
$this->serviceLocator = $serviceLocator; | |
return $this; | |
} | |
/** | |
* Get the service locator. | |
* | |
* @return \Zend\ServiceManager\ServiceLocatorInterface | |
*/ | |
public function getServiceLocator() | |
{ | |
return $this->serviceLocator; | |
} | |
public function __invoke() | |
{ | |
$helperPluginManager = $this->getServiceLocator(); | |
$serviceManager = $helperPluginManager->getServiceLocator(); | |
return $serviceManager->get('Session'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment