@@ -323,23 +323,23 @@
{{ form_row(child) }}
{% endfor %}
-{% endspaceless %}
+{% endapply %}
{% endblock s2a_google_map_widget %}
{% block s2a_money_widget %}
-{% spaceless %}
+{% apply spaceless %}
{{ money_pattern|replace({ '{{ widget }}': '' })|raw }}
{{ block('form_widget_simple')|raw }}
-{% endspaceless %}
+{% endapply %}
{% endblock %}
{% block s2a_daterange_picker_widget %}
-{% spaceless %}
+{% apply spaceless %}
{{ block('form_widget_simple') }}
-{% endspaceless %}
+{% endapply %}
{% endblock s2a_daterange_picker_widget %}
diff --git a/Resources/views/Form/form_js.html.twig b/Resources/views/Form/form_js.html.twig
index 0972fc6..6aacbd5 100644
--- a/Resources/views/Form/form_js.html.twig
+++ b/Resources/views/Form/form_js.html.twig
@@ -1,6 +1,6 @@
{% block s2a_bootstrap_collection_js_prototype %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
$field.bootstrapCollection({
allow_add: {{ allow_add|e4js }},
allow_delete: {{ allow_delete|e4js }},
@@ -26,13 +26,13 @@
{% endif %}
}
});
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_bootstrap_collection_js_prototype %}
{% block s2a_collection_fieldset_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_upload_collection_js %}
{% block s2a_daterange_picker_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_daterange_picker_js %}
{% block s2a_double_list_family_js_prototype_template %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
$field.doubleList();
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_double_list_family_js_prototype_template %}
{% block s2a_double_list_document_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_double_list_document_js %}
{% block s2a_double_list_entity_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_double_list_entity_js %}
{% block s2a_double_list_model_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_double_list_model_js %}
{% block s2a_knob_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_knob_js %}
{% block s2a_mini_colors_js %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endblock s2a_mini_colors_js %}
{% block s2a_select2_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_select2_js %}
{% block s2a_single_upload_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_single_upload_js %}
{% block s2a_elastic_textarea_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_elastic_textarea_js %}
{% block choice_js %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endblock choice_js %}
{% block s2a_datetime_family_js_prototype_template %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
var $widget = $('#'+$field.attr('id')+'_widget');
var config = {{ {
'locale': app.request.locale,
@@ -434,13 +434,13 @@
$widget.trigger("dp.change");
});
$field.closest('form').on('submit', copyValue);
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_datetime_family_js_prototype_template %}
{% block s2a_datetime_picker_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_datetime_picker_js %}
{% block s2a_date_picker_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_date_picker_js %}
{% block s2a_time_picker_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_time_picker_js %}
{% block s2a_google_map_js %}
{% autoescape false %}
-{% spaceless %}
+{% apply spaceless %}
-{% endspaceless %}
+{% endapply %}
{% endautoescape %}
{% endblock s2a_google_map_js %}
diff --git a/Twig/Extension/ImageAssetsExtension.php b/Twig/Extension/ImageAssetsExtension.php
index 28b24e8..59fa408 100644
--- a/Twig/Extension/ImageAssetsExtension.php
+++ b/Twig/Extension/ImageAssetsExtension.php
@@ -2,6 +2,10 @@
namespace Admingenerator\FormExtensionsBundle\Twig\Extension;
+use Twig\Extension\AbstractExtension;
+use Twig\TwigFilter;
+use Twig\TwigFunction;
+
/**
* This extension adds common twig function for various upload manager
* bundles and common twig filter image manipulation bundles.
@@ -14,7 +18,7 @@
*
* @author Piotr Gołębiewski
*/
-class ImageAssetsExtension extends \Twig_Extension
+class ImageAssetsExtension extends AbstractExtension
{
protected $uploaderExtension;
@@ -32,7 +36,7 @@ public function __construct($uploaderExtension, $filterExtension)
public function getFunctions()
{
return array(
- 'image_asset' => new \Twig_SimpleFunction('image_asset', array($this, 'asset')),
+ 'image_asset' => new TwigFunction('image_asset', array($this, 'asset')),
);
}
@@ -42,7 +46,7 @@ public function getFunctions()
public function getFilters()
{
return array(
- 'image_filter' => new \Twig_SimpleFilter('image_filter', array($this, 'filter')),
+ 'image_filter' => new TwigFilter('image_filter', array($this, 'filter')),
);
}
diff --git a/Twig/Extension/IncludeGlobalsExtension.php b/Twig/Extension/IncludeGlobalsExtension.php
index 28098e4..05a21dd 100644
--- a/Twig/Extension/IncludeGlobalsExtension.php
+++ b/Twig/Extension/IncludeGlobalsExtension.php
@@ -3,13 +3,15 @@
namespace Admingenerator\FormExtensionsBundle\Twig\Extension;
use Symfony\Component\DependencyInjection\ContainerInterface;
+use Twig\Extension\AbstractExtension;
+use Twig\Extension\GlobalsInterface;
/**
* This extension adds global variables based on bundles configuration.
*
* @author Piotr Gołębiewski
*/
-class IncludeGlobalsExtension extends \Twig_Extension implements \Twig_Extension_GlobalsInterface
+class IncludeGlobalsExtension extends AbstractExtension implements GlobalsInterface
{
protected $container;
diff --git a/composer.json b/composer.json
index 154a055..776b5da 100644
--- a/composer.json
+++ b/composer.json
@@ -15,19 +15,19 @@
}
],
"require": {
- "symfony/config": "~2.8|~3.0|~4.0",
- "symfony/dependency-injection": "~2.8|~3.0|~4.0",
- "symfony/event-dispatcher": "~2.8|~3.0|~4.0",
- "symfony/form": "~2.8|~3.0|~4.0",
- "symfony/http-foundation": "~2.8|~3.0|~4.0",
- "symfony/http-kernel": "~2.8|~3.0|~4.0",
- "symfony/options-resolver": "~2.8|~3.0|~4.0",
- "symfony/property-access": "~2.8|~3.0|~4.0",
- "symfony/translation": "~2.8|~3.0|~4.0",
- "symfony/validator": "~2.8|~3.0|~4.0",
- "twig/twig": "~1.26||~2.0",
- "twig/extensions": "~1.0",
- "symfony2admingenerator/form-bundle": "~1.5"
+ "symfony/config": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/dependency-injection": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/event-dispatcher": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/form": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/http-foundation": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/http-kernel": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/options-resolver": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/property-access": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/translation": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/twig-bridge": "~2.8|~3.0|~4.0|~5.0",
+ "symfony/validator": "~2.8|~3.0|~4.0|~5.0",
+ "twig/twig": "~1.40|~2.9|~3.0",
+ "symfony2admingenerator/form-bundle": "~1.7"
},
"suggest": {
"symfony2admingenerator/generator-bundle": "The missing symfony2 admin generator",
@@ -35,14 +35,13 @@
"vich/uploader-bundle": "(>= 0.10.0) Bundle to ease file uploads with ORM entities and ODM documents"
},
"autoload": {
- "psr-0": {
- "Admingenerator\\FormExtensionsBundle": ""
+ "psr-4": {
+ "Admingenerator\\FormExtensionsBundle\\": ""
}
},
- "target-dir": "Admingenerator/FormExtensionsBundle",
"extra": {
"branch-alias": {
- "dev-master": "2.0-dev"
+ "dev-master": "2.x-dev"
}
}
}