for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sludio\HelperBundle\Flash\Twig;
use Sludio\HelperBundle\Flash\Helper\FlashAlertsHelper;
use Sludio\HelperBundle\Script\Twig\TwigTrait;
class FlashExtension extends \Twig_Extension
{
use TwigTrait;
private $publisher;
/**
* @var FlashAlertsHelper
*/
private $helper;
public function __construct($shortFunctions, $publisher, $helper)
$this->shortFunctions = $shortFunctions;
$this->publisher = $publisher;
$this->helper = $helper;
}
public function getAlertPublisher()
return $this->publisher;
public function renderFlashAlerts(array $options = [])
return $this->helper->renderFlashAlerts($options);
public function getFunctions()
$input = [
'get_alert_publisher' => [
$this,
'getAlertPublisher',
['is_safe' => ['html']],
],
'render_flash_alerts' => [
'renderFlashAlerts',
];
return $this->makeArray($input, 'function');