Skip to content

Commit

Permalink
Fix deprecated Twig stuff usage
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh committed Aug 28, 2015
1 parent 99678a4 commit 805bf0a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Resources/views/Form/div_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
{% spaceless %}
{{ form_rest(form) }}

{% if map is sameas(true) %}
{% if map is same as(true) %}
<div id="{{ id }}_map">&nbsp;</div>
{% endif %}
{% endspaceless %}
Expand Down
10 changes: 5 additions & 5 deletions Resources/views/Form/jquery_layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<script type="text/javascript">
jQuery(document).ready(function($) {
$field = $('#{% if widget != "single_text" %}datepicker_{% endif %}{{ id }}');
{% block genemu_jquerydate_javascript_prototype %}
{% if configs.buttonImage is defined %}
Expand Down Expand Up @@ -332,7 +332,7 @@
{% endif %}
$autocompleter.autocomplete($configs);
{% if configs.minLength is defined and 0 == configs.minLength %}
$autocompleter.focus(function() {
$(this).autocomplete("search", "");
Expand Down Expand Up @@ -364,7 +364,7 @@
{% block genemu_jquerygeolocation_javascript %}
{% spaceless %}
{# Elements generation #}
{% if map is sameas(true) %}
{% if map is same as(true) %}
{% set elements = elements|merge({"map": "#" ~ id ~ "_map"}) %}
{% endif %}

Expand Down Expand Up @@ -395,7 +395,7 @@
$field.addresspicker({{ configs|json_encode|raw }});
{% if map is sameas(true) %}
{% if map is same as(true) %}
var gmarker = $field.addresspicker('marker');
gmarker.setVisible(true);
Expand Down Expand Up @@ -450,7 +450,7 @@
}
});
{% if configs.auto is not defined or configs.auto is sameas(false) %}
{% if configs.auto is not defined or configs.auto is same as(false) %}
$configs.onAllComplete = function(event, data) {
$form.submit();
};
Expand Down
7 changes: 5 additions & 2 deletions Twig/Extension/FormExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ public function __construct(TwigRendererInterface $renderer)
public function getFunctions()
{
return array(
'form_javascript' => new \Twig_Function_Method($this, 'renderJavascript', array('is_safe' => array('html'))),
'form_stylesheet' => new \Twig_Function_Node('Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode', array('is_safe' => array('html'))),
new \Twig_SimpleFunction('form_javascript', array($this, 'renderJavascript'), array('is_safe' => array('html'))),
new \Twig_SimpleFunction('form_stylesheet', null, array(
'is_safe' => array('html'),
'node_class' => 'Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode',
)),
);
}

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"require": {
"php": ">=5.3.2",
"symfony/framework-bundle": "~2.6",
"symfony/form": "~2.6"
"symfony/form": "~2.6",
"twig/twig": "~1.14"
},
"require-dev": {
"symfony/doctrine-bridge": "~2.6",
Expand Down

0 comments on commit 805bf0a

Please sign in to comment.