Created
February 10, 2017 01:58
-
-
Save abdullahseba/a37a6c5392a5057ac20af5170af4965f 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 UserFrosting\Sprinkle\Site2\Twig; | |
use Interop\Container\ContainerInterface; | |
class Site2Extension extends \Twig_Extension | |
{ | |
protected $services; | |
/** | |
* Constructor. | |
* | |
* @param ContainerInterface $services The global container object, which holds all your services. | |
*/ | |
public function __construct(ContainerInterface $services) | |
{ | |
$this->services = $services; | |
} | |
/** | |
* Get the name of this extension. | |
* | |
* @return string | |
*/ | |
public function getName() | |
{ | |
return 'userfrosting/Site2'; | |
} | |
/** | |
* Adds Twig global variables `twigVar`. | |
* | |
* @return array[mixed] | |
*/ | |
public function getGlobals() | |
{ | |
$yourVar = [ | |
'myfields' => 'test' | |
]; | |
return $yourVar; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment