mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-03 21:34:59 +00:00
sf4 resolve errors and depreciations
This commit is contained in:
@@ -22,13 +22,16 @@
|
||||
|
||||
namespace Chill\MainBundle\Templating;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
/**
|
||||
* Twig filter to transform a string in a safer way to be the content of a csv
|
||||
* cell.
|
||||
*
|
||||
* This filter replace the char " by ""
|
||||
*/
|
||||
class CSVCellTwig extends \Twig_Extension
|
||||
class CSVCellTwig extends AbstractExtension
|
||||
{
|
||||
/*
|
||||
* Returns a list of filters to add to the existing list.
|
||||
@@ -39,7 +42,7 @@ class CSVCellTwig extends \Twig_Extension
|
||||
public function getFilters()
|
||||
{
|
||||
return array(
|
||||
new \Twig_SimpleFilter(
|
||||
new TwigFilter(
|
||||
'csv_cell',
|
||||
array($this, 'csvCellFilter'),
|
||||
array('is_safe' => array('html')))
|
||||
|
@@ -21,6 +21,7 @@
|
||||
namespace Chill\MainBundle\Templating;
|
||||
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\Node\Node;
|
||||
use Twig\TwigFunction;
|
||||
use Twig\TwigFilter;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
@@ -72,7 +73,7 @@ class ChillTwigRoutingHelper extends AbstractExtension
|
||||
];
|
||||
}
|
||||
|
||||
public function isUrlGenerationSafe(\Twig_Node $argsNode)
|
||||
public function isUrlGenerationSafe(Node $argsNode)
|
||||
{
|
||||
return $this->originalExtension->isUrlGenerationSafe($argsNode);
|
||||
}
|
||||
|
@@ -22,8 +22,10 @@
|
||||
namespace Chill\MainBundle\Templating;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFilter;
|
||||
|
||||
class TranslatableStringTwig extends \Twig_Extension
|
||||
class TranslatableStringTwig extends AbstractExtension
|
||||
{
|
||||
use ContainerAwareTrait;
|
||||
|
||||
@@ -51,7 +53,7 @@ class TranslatableStringTwig extends \Twig_Extension
|
||||
public function getFilters()
|
||||
{
|
||||
return array(
|
||||
new \Twig_SimpleFilter(
|
||||
new TwigFilter(
|
||||
'localize_translatable_string', array($this, 'localize')));
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,8 @@ namespace Chill\MainBundle\Templating\Widget;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Chill\MainBundle\Templating\Widget\WidgetInterface;
|
||||
use Chill\MainBundle\Templating\Events\DelegatedBlockRenderingEvent;
|
||||
use Twig\Extension\AbstractExtension;
|
||||
use Twig\TwigFunction;
|
||||
|
||||
/**
|
||||
* Add the function `chill_delegated_block`.
|
||||
@@ -49,7 +51,7 @@ use Chill\MainBundle\Templating\Events\DelegatedBlockRenderingEvent;
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class WidgetRenderingTwig extends \Twig_Extension
|
||||
class WidgetRenderingTwig extends AbstractExtension
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -90,14 +92,14 @@ class WidgetRenderingTwig extends \Twig_Extension
|
||||
public function getFunctions()
|
||||
{
|
||||
return array(
|
||||
new \Twig_SimpleFunction('chill_delegated_block',
|
||||
new TwigFunction('chill_delegated_block',
|
||||
array($this, 'renderingWidget'),
|
||||
array(
|
||||
'is_safe' => array('html'),
|
||||
'needs_environment' => true,
|
||||
'deprecated' => true, 'alternative' => 'chill_widget'
|
||||
)),
|
||||
new \Twig_SimpleFunction('chill_widget',
|
||||
new TwigFunction('chill_widget',
|
||||
array($this, 'renderingWidget'),
|
||||
array('is_safe' => array('html'), 'needs_environment' => true))
|
||||
);
|
||||
|
Reference in New Issue
Block a user