mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
fix new namespace of twig extensions
This commit is contained in:
parent
3f9939deb9
commit
1c163df081
@ -27,6 +27,8 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\DependencyInjection\Container;
|
use Symfony\Component\DependencyInjection\Container;
|
||||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
use Chill\CustomFieldsBundle\Entity\CustomField;
|
||||||
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the following Twig Extension :
|
* Add the following Twig Extension :
|
||||||
@ -35,7 +37,7 @@ use Chill\CustomFieldsBundle\Entity\CustomField;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class CustomFieldRenderingTwig extends \Twig_Extension implements ContainerAwareInterface
|
class CustomFieldRenderingTwig extends AbstractExtension implements ContainerAwareInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var Container $container The container */
|
/** @var Container $container The container */
|
||||||
@ -72,7 +74,7 @@ class CustomFieldRenderingTwig extends \Twig_Extension implements ContainerAware
|
|||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
new \Twig_SimpleFunction('chill_custom_field_widget', array(
|
new TwigFunction('chill_custom_field_widget', array(
|
||||||
$this,
|
$this,
|
||||||
'renderWidget'
|
'renderWidget'
|
||||||
), array(
|
), array(
|
||||||
@ -80,7 +82,7 @@ class CustomFieldRenderingTwig extends \Twig_Extension implements ContainerAware
|
|||||||
'html'
|
'html'
|
||||||
)
|
)
|
||||||
)),
|
)),
|
||||||
new \Twig_SimpleFunction('chill_custom_field_label', array(
|
new TwigFunction('chill_custom_field_label', array(
|
||||||
$this,
|
$this,
|
||||||
'renderLabel'
|
'renderLabel'
|
||||||
), array(
|
), array(
|
||||||
@ -88,7 +90,7 @@ class CustomFieldRenderingTwig extends \Twig_Extension implements ContainerAware
|
|||||||
'html'
|
'html'
|
||||||
)
|
)
|
||||||
)),
|
)),
|
||||||
new \Twig_SimpleFunction('chill_custom_field_is_empty', array(
|
new TwigFunction('chill_custom_field_is_empty', array(
|
||||||
$this,
|
$this,
|
||||||
'isEmptyValue'
|
'isEmptyValue'
|
||||||
))
|
))
|
||||||
|
@ -25,7 +25,8 @@ namespace Chill\CustomFieldsBundle\Templating\Twig;
|
|||||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Component\DependencyInjection\Container;
|
use Symfony\Component\DependencyInjection\Container;
|
||||||
use Chill\CustomFieldsBundle\Entity\CustomField;
|
use Twig\Extension\AbstractExtension;
|
||||||
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the following Twig Extension :
|
* Add the following Twig Extension :
|
||||||
@ -35,7 +36,7 @@ use Chill\CustomFieldsBundle\Entity\CustomField;
|
|||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
* @author Marc Ducobu <marc.ducobu@champs-libres.coop>
|
* @author Marc Ducobu <marc.ducobu@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class CustomFieldsGroupRenderingTwig extends \Twig_Extension implements ContainerAwareInterface
|
class CustomFieldsGroupRenderingTwig extends AbstractExtension implements ContainerAwareInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/** @var Container $container The container */
|
/** @var Container $container The container */
|
||||||
@ -72,7 +73,7 @@ class CustomFieldsGroupRenderingTwig extends \Twig_Extension implements Containe
|
|||||||
public function getFunctions()
|
public function getFunctions()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
new \Twig_SimpleFunction('chill_custom_fields_group_widget', array(
|
new TwigFunction('chill_custom_fields_group_widget', array(
|
||||||
$this,
|
$this,
|
||||||
'renderWidget'
|
'renderWidget'
|
||||||
), array(
|
), array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user