Skip to content

Commit 805bf0a

Browse files
committed
Fix deprecated Twig stuff usage
1 parent 99678a4 commit 805bf0a

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

Resources/views/Form/div_layout.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
{% spaceless %}
7272
{{ form_rest(form) }}
7373

74-
{% if map is sameas(true) %}
74+
{% if map is same as(true) %}
7575
<div id="{{ id }}_map">&nbsp;</div>
7676
{% endif %}
7777
{% endspaceless %}

Resources/views/Form/jquery_layout.html.twig

+5-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
<script type="text/javascript">
9292
jQuery(document).ready(function($) {
9393
$field = $('#{% if widget != "single_text" %}datepicker_{% endif %}{{ id }}');
94-
94+
9595
{% block genemu_jquerydate_javascript_prototype %}
9696
9797
{% if configs.buttonImage is defined %}
@@ -332,7 +332,7 @@
332332
{% endif %}
333333
334334
$autocompleter.autocomplete($configs);
335-
335+
336336
{% if configs.minLength is defined and 0 == configs.minLength %}
337337
$autocompleter.focus(function() {
338338
$(this).autocomplete("search", "");
@@ -364,7 +364,7 @@
364364
{% block genemu_jquerygeolocation_javascript %}
365365
{% spaceless %}
366366
{# Elements generation #}
367-
{% if map is sameas(true) %}
367+
{% if map is same as(true) %}
368368
{% set elements = elements|merge({"map": "#" ~ id ~ "_map"}) %}
369369
{% endif %}
370370

@@ -395,7 +395,7 @@
395395
396396
$field.addresspicker({{ configs|json_encode|raw }});
397397
398-
{% if map is sameas(true) %}
398+
{% if map is same as(true) %}
399399
var gmarker = $field.addresspicker('marker');
400400
gmarker.setVisible(true);
401401
@@ -450,7 +450,7 @@
450450
}
451451
});
452452
453-
{% if configs.auto is not defined or configs.auto is sameas(false) %}
453+
{% if configs.auto is not defined or configs.auto is same as(false) %}
454454
$configs.onAllComplete = function(event, data) {
455455
$form.submit();
456456
};

Twig/Extension/FormExtension.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ public function __construct(TwigRendererInterface $renderer)
4545
public function getFunctions()
4646
{
4747
return array(
48-
'form_javascript' => new \Twig_Function_Method($this, 'renderJavascript', array('is_safe' => array('html'))),
49-
'form_stylesheet' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))),
48+
new \Twig_SimpleFunction('form_javascript', array($this, 'renderJavascript'), array('is_safe' => array('html'))),
49+
new \Twig_SimpleFunction('form_stylesheet', null, array(
50+
'is_safe' => array('html'),
51+
'node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode',
52+
)),
5053
);
5154
}
5255

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
"require": {
2323
"php": ">=5.3.2",
2424
"symfony/framework-bundle": "~2.6",
25-
"symfony/form": "~2.6"
25+
"symfony/form": "~2.6",
26+
"twig/twig": "~1.14"
2627
},
2728
"require-dev": {
2829
"symfony/doctrine-bridge": "~2.6",

0 commit comments

Comments
 (0)