for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SumoCoders\FrameworkErrorBundle\Twig;
/**
* NotifierExtension
*/
class NotifierExtension extends \Twig_Extension
{
* @var \Twig_Environment
protected $twig;
* @var string
protected $host;
protected $apiKey;
* Class constructor
*
* @param \Twig_Environment $twig
* @param string $host
* @param string $apiKey
public function __construct(\Twig_Environment $twig, $host, $apiKey)
$this->twig = $twig;
$this->host = $host;
$this->apiKey = $apiKey;
}
* {@inheritDoc}
public function getFunctions()
return array(
new \Twig_SimpleFunction(
'errbit_notifier',
array($this, 'getErrbitNotifier'),
array(
'is_safe' => array('html'),
)
);
* Returns the HTML that will be inserted by rendering the template
* @return string
public function getErrbitNotifier()
return $this->twig->render(
'SumoCodersFrameworkErrorBundle:Extension:notifier.html.twig',
'host' => $this->host,
'api_key' => $this->apiKey,
public function getName()
return 'errbit_notifier_extension';