Skip to content

Instantly share code, notes, and snippets.

@abdullahseba
Created February 10, 2017 01:58
Show Gist options
  • Save abdullahseba/a37a6c5392a5057ac20af5170af4965f to your computer and use it in GitHub Desktop.
Save abdullahseba/a37a6c5392a5057ac20af5170af4965f to your computer and use it in GitHub Desktop.
<?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