Created
July 8, 2012 22:36
-
-
Save boonkerz/3073222 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 | |
namespace TaKeTV\PortalBundle\Twig; | |
use CCDNComponent\CommonBundle\Manager\ManagerInterface; | |
use Symfony\Component\DependencyInjection; | |
class SiteExtension extends \Twig_Extension | |
{ | |
private $serviceContainer = false; | |
public function __construct($serviceContainer) { | |
$this->serviceContainer = $serviceContainer; | |
} | |
public function getGlobals() | |
{ | |
return array('site' => $this->site()); | |
} | |
public function site() | |
{ | |
return $this->serviceContainer->get('taketv.site.manager')->getSite(); | |
} | |
public function getName() | |
{ | |
return 'site'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment