Skip to content

Commit 4c39bb2

Browse files
author
Simonas Šerlinskas
committed
twig extension pager function names conflicts fix
There are other twig functions with same name, so we need to add prefix here.
1 parent d676f1c commit 4c39bb2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<ul class="pagination">
22
{% if pager.isFirstPage == false %}
3-
<li class="first"><a href="{{ paginate_path(route, pager.getFirstPage, parameters) }}">&laquo;</a></li>
4-
<li class="previous"><a href="{{ paginate_path(route, pager.getPreviousPage, parameters) }}">&lsaquo;</a></li>
3+
<li class="first"><a href="{{ ongr_paginate_path(route, pager.getFirstPage, parameters) }}">&laquo;</a></li>
4+
<li class="previous"><a href="{{ ongr_paginate_path(route, pager.getPreviousPage, parameters) }}">&lsaquo;</a></li>
55
{% endif %}
66
{% for page in pager.getPages %}
77
<li class="{% if page == pager.getPage %}active{% endif %}">
8-
<a href="{{ paginate_path(route, page, parameters) }}">{{ page }}</a>
8+
<a href="{{ ongr_paginate_path(route, page, parameters) }}">{{ page }}</a>
99
</li>
1010
{% endfor %}
1111
{% if pager.isLastPage == false %}
12-
<li class="next"><a href="{{ paginate_path(route, pager.getNextPage, parameters) }}">&rsaquo;</a></li>
13-
<li class="last"><a href="{{ paginate_path(route, pager.getLastPage, parameters) }}">&raquo;</a></li>
12+
<li class="next"><a href="{{ ongr_paginate_path(route, pager.getNextPage, parameters) }}">&rsaquo;</a></li>
13+
<li class="last"><a href="{{ ongr_paginate_path(route, pager.getLastPage, parameters) }}">&raquo;</a></li>
1414
{% endif %}
1515
</ul>

Twig/PagerExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class PagerExtension extends \Twig_Extension
2222
/**
2323
* Twig extension name.
2424
*/
25-
const NAME = 'ongr.pager';
25+
const NAME = 'ongr_pager';
2626

2727
/**
2828
* @var RouterInterface
@@ -56,8 +56,8 @@ public function initRuntime(\Twig_Environment $environment)
5656
public function getFunctions()
5757
{
5858
return [
59-
new \Twig_SimpleFunction('paginate', [$this, 'paginate'], ['is_safe' => ['html']]),
60-
new \Twig_SimpleFunction('paginate_path', [$this, 'path'], ['is_safe' => ['html']]),
59+
new \Twig_SimpleFunction('ongr_paginate', [$this, 'paginate'], ['is_safe' => ['html']]),
60+
new \Twig_SimpleFunction('ongr_paginate_path', [$this, 'path'], ['is_safe' => ['html']]),
6161
];
6262
}
6363

0 commit comments

Comments
 (0)