diff --git a/Twig/Extension/UploaderExtension.php b/Twig/Extension/UploaderExtension.php index a8664b11..a5a7c440 100644 --- a/Twig/Extension/UploaderExtension.php +++ b/Twig/Extension/UploaderExtension.php @@ -3,8 +3,10 @@ namespace Oneup\UploaderBundle\Twig\Extension; use Oneup\UploaderBundle\Templating\Helper\UploaderHelper; +use Twig\Extension\AbstractExtension; +use Twig\TwigFunction; -class UploaderExtension extends \Twig_Extension +class UploaderExtension extends AbstractExtension { protected $helper; @@ -21,11 +23,11 @@ public function getName() public function getFunctions() { return [ - new \Twig_SimpleFunction('oneup_uploader_endpoint', [$this, 'endpoint']), - new \Twig_SimpleFunction('oneup_uploader_progress', [$this, 'progress']), - new \Twig_SimpleFunction('oneup_uploader_cancel', [$this, 'cancel']), - new \Twig_SimpleFunction('oneup_uploader_upload_key', [$this, 'uploadKey']), - new \Twig_SimpleFunction('oneup_uploader_maxsize', [$this, 'maxSize']), + new TwigFunction('oneup_uploader_endpoint', [$this, 'endpoint']), + new TwigFunction('oneup_uploader_progress', [$this, 'progress']), + new TwigFunction('oneup_uploader_cancel', [$this, 'cancel']), + new TwigFunction('oneup_uploader_upload_key', [$this, 'uploadKey']), + new TwigFunction('oneup_uploader_maxsize', [$this, 'maxSize']), ]; } diff --git a/composer.json b/composer.json index 6da94639..3a90d012 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "symfony/http-foundation": "^3.0|^4.0", "symfony/templating": "^3.0|^4.0", "symfony/translation": "^3.0|^4.0", - "symfony/yaml": "^3.0|^4.0" + "symfony/yaml": "^3.0|^4.0", + "twig/twig": "^1.41|^2.10|^3.0" }, "require-dev": {