var/cache/dev/twig/52/52d55029a4decc6c09687e6764cb9719.php line 60

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* knp_menu.html.twig */
  16. class __TwigTemplate_803920045b3ee151afa20359cf3ae0d3 extends Netgen\Bundle\SiteBundle\Templating\Twig\DebugTemplate
  17. {
  18. private Source $source;
  19. /**
  20. * @var array<string, Template>
  21. */
  22. private array $macros = [];
  23. public function __construct(Environment $env)
  24. {
  25. parent::__construct($env);
  26. $this->source = $this->getSourceContext();
  27. $this->blocks = [
  28. 'compressed_root' => [$this, 'block_compressed_root'],
  29. 'root' => [$this, 'block_root'],
  30. 'list' => [$this, 'block_list'],
  31. 'children' => [$this, 'block_children'],
  32. 'item' => [$this, 'block_item'],
  33. 'linkElement' => [$this, 'block_linkElement'],
  34. 'spanElement' => [$this, 'block_spanElement'],
  35. 'label' => [$this, 'block_label'],
  36. ];
  37. }
  38. protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  39. {
  40. // line 1
  41. return "knp_menu_base.html.twig";
  42. }
  43. protected function doDisplay(array $context, array $blocks = []): iterable
  44. {
  45. $macros = $this->macros;
  46. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  47. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "knp_menu.html.twig"));
  48. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  49. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "knp_menu.html.twig"));
  50. $this->parent = $this->load("knp_menu_base.html.twig", 1);
  51. yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  52. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  53. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  54. }
  55. // line 11
  56. /**
  57. * @return iterable<null|scalar|\Stringable>
  58. */
  59. public function block_compressed_root(array $context, array $blocks = []): iterable
  60. {
  61. $macros = $this->macros;
  62. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  63. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "compressed_root"));
  64. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  65. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "compressed_root"));
  66. // line 12
  67. $_v0 = ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
  68. // line 13
  69. yield from $this->unwrap()->yieldBlock("root", $context, $blocks);
  70. yield "
  71. ";
  72. yield from [];
  73. })())) ? '' : new Markup($tmp, $this->env->getCharset());
  74. // line 12
  75. yield Knp\Menu\Twig\MenuExtension::spaceless($_v0);
  76. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  77. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  78. yield from [];
  79. }
  80. // line 17
  81. /**
  82. * @return iterable<null|scalar|\Stringable>
  83. */
  84. public function block_root(array $context, array $blocks = []): iterable
  85. {
  86. $macros = $this->macros;
  87. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  88. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "root"));
  89. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  90. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "root"));
  91. // line 18
  92. $context["listAttributes"] = Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 18, $this->source); })()), "childrenAttributes", [], "any", false, false, false, 18);
  93. // line 19
  94. yield from $this->unwrap()->yieldBlock("list", $context, $blocks);
  95. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  96. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  97. yield from [];
  98. }
  99. // line 22
  100. /**
  101. * @return iterable<null|scalar|\Stringable>
  102. */
  103. public function block_list(array $context, array $blocks = []): iterable
  104. {
  105. $macros = $this->macros;
  106. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  107. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "list"));
  108. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  109. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "list"));
  110. // line 23
  111. if (((Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 23, $this->source); })()), "hasChildren", [], "any", false, false, false, 23) && !(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 23, $this->source); })()), "depth", [], "any", false, false, false, 23) === 0)) && Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 23, $this->source); })()), "displayChildren", [], "any", false, false, false, 23))) {
  112. // line 24
  113. yield " ";
  114. $macros["knp_menu"] = $this;
  115. // line 25
  116. yield " <ul";
  117. yield $macros["knp_menu"]->getTemplateForMacro("macro_attributes", $context, 25, $this->getSourceContext())->macro_attributes(...[(isset($context["listAttributes"]) || array_key_exists("listAttributes", $context) ? $context["listAttributes"] : (function () { throw new RuntimeError('Variable "listAttributes" does not exist.', 25, $this->source); })())]);
  118. yield ">
  119. ";
  120. // line 26
  121. yield from $this->unwrap()->yieldBlock("children", $context, $blocks);
  122. yield "
  123. </ul>
  124. ";
  125. }
  126. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  127. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  128. yield from [];
  129. }
  130. // line 31
  131. /**
  132. * @return iterable<null|scalar|\Stringable>
  133. */
  134. public function block_children(array $context, array $blocks = []): iterable
  135. {
  136. $macros = $this->macros;
  137. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  138. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "children"));
  139. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  140. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "children"));
  141. // line 33
  142. $context["currentOptions"] = (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 33, $this->source); })());
  143. // line 34
  144. $context["currentItem"] = (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 34, $this->source); })());
  145. // line 36
  146. if ((($tmp = !(null === Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 36, $this->source); })()), "depth", [], "any", false, false, false, 36))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  147. // line 37
  148. $context["options"] = Twig\Extension\CoreExtension::merge((isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 37, $this->source); })()), ["depth" => (Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["currentOptions"]) || array_key_exists("currentOptions", $context) ? $context["currentOptions"] : (function () { throw new RuntimeError('Variable "currentOptions" does not exist.', 37, $this->source); })()), "depth", [], "any", false, false, false, 37) - 1)]);
  149. }
  150. // line 40
  151. if (( !(null === Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 40, $this->source); })()), "matchingDepth", [], "any", false, false, false, 40)) && (Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 40, $this->source); })()), "matchingDepth", [], "any", false, false, false, 40) > 0))) {
  152. // line 41
  153. $context["options"] = Twig\Extension\CoreExtension::merge((isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 41, $this->source); })()), ["matchingDepth" => (Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["currentOptions"]) || array_key_exists("currentOptions", $context) ? $context["currentOptions"] : (function () { throw new RuntimeError('Variable "currentOptions" does not exist.', 41, $this->source); })()), "matchingDepth", [], "any", false, false, false, 41) - 1)]);
  154. }
  155. // line 43
  156. $context['_parent'] = $context;
  157. $context['_seq'] = CoreExtension::ensureTraversable(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["currentItem"]) || array_key_exists("currentItem", $context) ? $context["currentItem"] : (function () { throw new RuntimeError('Variable "currentItem" does not exist.', 43, $this->source); })()), "children", [], "any", false, false, false, 43));
  158. $context['loop'] = [
  159. 'parent' => $context['_parent'],
  160. 'index0' => 0,
  161. 'index' => 1,
  162. 'first' => true,
  163. ];
  164. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  165. $length = count($context['_seq']);
  166. $context['loop']['revindex0'] = $length - 1;
  167. $context['loop']['revindex'] = $length;
  168. $context['loop']['length'] = $length;
  169. $context['loop']['last'] = 1 === $length;
  170. }
  171. foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
  172. // line 44
  173. yield " ";
  174. yield from $this->unwrap()->yieldBlock("item", $context, $blocks);
  175. yield "
  176. ";
  177. ++$context['loop']['index0'];
  178. ++$context['loop']['index'];
  179. $context['loop']['first'] = false;
  180. if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  181. --$context['loop']['revindex0'];
  182. --$context['loop']['revindex'];
  183. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  184. }
  185. }
  186. $_parent = $context['_parent'];
  187. unset($context['_seq'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
  188. $context = array_intersect_key($context, $_parent) + $_parent;
  189. // line 47
  190. $context["item"] = (isset($context["currentItem"]) || array_key_exists("currentItem", $context) ? $context["currentItem"] : (function () { throw new RuntimeError('Variable "currentItem" does not exist.', 47, $this->source); })());
  191. // line 48
  192. $context["options"] = (isset($context["currentOptions"]) || array_key_exists("currentOptions", $context) ? $context["currentOptions"] : (function () { throw new RuntimeError('Variable "currentOptions" does not exist.', 48, $this->source); })());
  193. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  194. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  195. yield from [];
  196. }
  197. // line 51
  198. /**
  199. * @return iterable<null|scalar|\Stringable>
  200. */
  201. public function block_item(array $context, array $blocks = []): iterable
  202. {
  203. $macros = $this->macros;
  204. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  205. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "item"));
  206. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  207. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "item"));
  208. // line 52
  209. if ((($tmp = Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 52, $this->source); })()), "displayed", [], "any", false, false, false, 52)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  210. // line 54
  211. $context["classes"] = (((($tmp = !Twig\Extension\CoreExtension::testEmpty(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 54, $this->source); })()), "attribute", ["class"], "method", false, false, false, 54))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ([Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 54, $this->source); })()), "attribute", ["class"], "method", false, false, false, 54)]) : ([]));
  212. // line 55
  213. if ((($tmp = Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["matcher"]) || array_key_exists("matcher", $context) ? $context["matcher"] : (function () { throw new RuntimeError('Variable "matcher" does not exist.', 55, $this->source); })()), "isCurrent", [(isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 55, $this->source); })())], "method", false, false, false, 55)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  214. // line 56
  215. $context["classes"] = Twig\Extension\CoreExtension::merge((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 56, $this->source); })()), [Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 56, $this->source); })()), "currentClass", [], "any", false, false, false, 56)]);
  216. } elseif ((($tmp = Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, // line 57
  217. (isset($context["matcher"]) || array_key_exists("matcher", $context) ? $context["matcher"] : (function () { throw new RuntimeError('Variable "matcher" does not exist.', 57, $this->source); })()), "isAncestor", [(isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 57, $this->source); })()), Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 57, $this->source); })()), "matchingDepth", [], "any", false, false, false, 57)], "method", false, false, false, 57)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  218. // line 58
  219. $context["classes"] = Twig\Extension\CoreExtension::merge((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 58, $this->source); })()), [Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 58, $this->source); })()), "ancestorClass", [], "any", false, false, false, 58)]);
  220. }
  221. // line 60
  222. if ((($tmp = Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 60, $this->source); })()), "actsLikeFirst", [], "any", false, false, false, 60)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  223. // line 61
  224. $context["classes"] = Twig\Extension\CoreExtension::merge((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 61, $this->source); })()), [Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 61, $this->source); })()), "firstClass", [], "any", false, false, false, 61)]);
  225. }
  226. // line 63
  227. if ((($tmp = Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 63, $this->source); })()), "actsLikeLast", [], "any", false, false, false, 63)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  228. // line 64
  229. $context["classes"] = Twig\Extension\CoreExtension::merge((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 64, $this->source); })()), [Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 64, $this->source); })()), "lastClass", [], "any", false, false, false, 64)]);
  230. }
  231. // line 66
  232. yield "
  233. ";
  234. // line 68
  235. yield " ";
  236. if ((Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 68, $this->source); })()), "hasChildren", [], "any", false, false, false, 68) && !(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 68, $this->source); })()), "depth", [], "any", false, false, false, 68) === 0))) {
  237. // line 69
  238. yield " ";
  239. if (( !Twig\Extension\CoreExtension::testEmpty(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 69, $this->source); })()), "branch_class", [], "any", false, false, false, 69)) && Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 69, $this->source); })()), "displayChildren", [], "any", false, false, false, 69))) {
  240. // line 70
  241. $context["classes"] = Twig\Extension\CoreExtension::merge((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 70, $this->source); })()), [Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 70, $this->source); })()), "branch_class", [], "any", false, false, false, 70)]);
  242. // line 71
  243. yield " ";
  244. }
  245. // line 72
  246. yield " ";
  247. } elseif ((($tmp = !Twig\Extension\CoreExtension::testEmpty(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 72, $this->source); })()), "leaf_class", [], "any", false, false, false, 72))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  248. // line 73
  249. $context["classes"] = Twig\Extension\CoreExtension::merge((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 73, $this->source); })()), [Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 73, $this->source); })()), "leaf_class", [], "any", false, false, false, 73)]);
  250. }
  251. // line 76
  252. $context["attributes"] = Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 76, $this->source); })()), "attributes", [], "any", false, false, false, 76);
  253. // line 77
  254. if ((($tmp = !Twig\Extension\CoreExtension::testEmpty((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 77, $this->source); })()))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  255. // line 78
  256. $context["attributes"] = Twig\Extension\CoreExtension::merge((isset($context["attributes"]) || array_key_exists("attributes", $context) ? $context["attributes"] : (function () { throw new RuntimeError('Variable "attributes" does not exist.', 78, $this->source); })()), ["class" => Twig\Extension\CoreExtension::join((isset($context["classes"]) || array_key_exists("classes", $context) ? $context["classes"] : (function () { throw new RuntimeError('Variable "classes" does not exist.', 78, $this->source); })()), " ")]);
  257. }
  258. // line 81
  259. yield " ";
  260. $macros["knp_menu"] = $this;
  261. // line 82
  262. yield " <li";
  263. yield $macros["knp_menu"]->getTemplateForMacro("macro_attributes", $context, 82, $this->getSourceContext())->macro_attributes(...[(isset($context["attributes"]) || array_key_exists("attributes", $context) ? $context["attributes"] : (function () { throw new RuntimeError('Variable "attributes" does not exist.', 82, $this->source); })())]);
  264. yield ">";
  265. // line 83
  266. if (( !Twig\Extension\CoreExtension::testEmpty(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 83, $this->source); })()), "uri", [], "any", false, false, false, 83)) && ( !Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["matcher"]) || array_key_exists("matcher", $context) ? $context["matcher"] : (function () { throw new RuntimeError('Variable "matcher" does not exist.', 83, $this->source); })()), "isCurrent", [(isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 83, $this->source); })())], "method", false, false, false, 83) || Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 83, $this->source); })()), "currentAsLink", [], "any", false, false, false, 83)))) {
  267. // line 84
  268. yield " ";
  269. yield from $this->unwrap()->yieldBlock("linkElement", $context, $blocks);
  270. } else {
  271. // line 86
  272. yield " ";
  273. yield from $this->unwrap()->yieldBlock("spanElement", $context, $blocks);
  274. }
  275. // line 89
  276. $context["childrenClasses"] = (((($tmp = !Twig\Extension\CoreExtension::testEmpty(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 89, $this->source); })()), "childrenAttribute", ["class"], "method", false, false, false, 89))) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ([Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 89, $this->source); })()), "childrenAttribute", ["class"], "method", false, false, false, 89)]) : ([]));
  277. // line 90
  278. $context["childrenClasses"] = Twig\Extension\CoreExtension::merge((isset($context["childrenClasses"]) || array_key_exists("childrenClasses", $context) ? $context["childrenClasses"] : (function () { throw new RuntimeError('Variable "childrenClasses" does not exist.', 90, $this->source); })()), [("menu_level_" . Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 90, $this->source); })()), "level", [], "any", false, false, false, 90))]);
  279. // line 91
  280. $context["listAttributes"] = Twig\Extension\CoreExtension::merge(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 91, $this->source); })()), "childrenAttributes", [], "any", false, false, false, 91), ["class" => Twig\Extension\CoreExtension::join((isset($context["childrenClasses"]) || array_key_exists("childrenClasses", $context) ? $context["childrenClasses"] : (function () { throw new RuntimeError('Variable "childrenClasses" does not exist.', 91, $this->source); })()), " ")]);
  281. // line 92
  282. yield " ";
  283. yield from $this->unwrap()->yieldBlock("list", $context, $blocks);
  284. yield "
  285. </li>
  286. ";
  287. }
  288. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  289. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  290. yield from [];
  291. }
  292. // line 97
  293. /**
  294. * @return iterable<null|scalar|\Stringable>
  295. */
  296. public function block_linkElement(array $context, array $blocks = []): iterable
  297. {
  298. $macros = $this->macros;
  299. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  300. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "linkElement"));
  301. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  302. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "linkElement"));
  303. $macros["knp_menu"] = $this;
  304. yield "<a href=\"";
  305. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 97, $this->source); })()), "uri", [], "any", false, false, false, 97), "html", null, true);
  306. yield "\"";
  307. yield $macros["knp_menu"]->getTemplateForMacro("macro_attributes", $context, 97, $this->getSourceContext())->macro_attributes(...[Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 97, $this->source); })()), "linkAttributes", [], "any", false, false, false, 97)]);
  308. yield ">";
  309. yield from $this->unwrap()->yieldBlock("label", $context, $blocks);
  310. yield "</a>";
  311. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  312. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  313. yield from [];
  314. }
  315. // line 99
  316. /**
  317. * @return iterable<null|scalar|\Stringable>
  318. */
  319. public function block_spanElement(array $context, array $blocks = []): iterable
  320. {
  321. $macros = $this->macros;
  322. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  323. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "spanElement"));
  324. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  325. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "spanElement"));
  326. $macros["knp_menu"] = $this;
  327. yield "<span";
  328. yield $macros["knp_menu"]->getTemplateForMacro("macro_attributes", $context, 99, $this->getSourceContext())->macro_attributes(...[Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 99, $this->source); })()), "labelAttributes", [], "any", false, false, false, 99)]);
  329. yield ">";
  330. yield from $this->unwrap()->yieldBlock("label", $context, $blocks);
  331. yield "</span>";
  332. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  333. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  334. yield from [];
  335. }
  336. // line 101
  337. /**
  338. * @return iterable<null|scalar|\Stringable>
  339. */
  340. public function block_label(array $context, array $blocks = []): iterable
  341. {
  342. $macros = $this->macros;
  343. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  344. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "label"));
  345. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  346. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "label"));
  347. if ((Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["options"]) || array_key_exists("options", $context) ? $context["options"] : (function () { throw new RuntimeError('Variable "options" does not exist.', 101, $this->source); })()), "allow_safe_labels", [], "any", false, false, false, 101) && Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 101, $this->source); })()), "getExtra", ["safe_label", false], "method", false, false, false, 101))) {
  348. yield Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 101, $this->source); })()), "label", [], "any", false, false, false, 101);
  349. } else {
  350. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Netgen\Bundle\IbexaSiteApiBundle\Templating\Twig\Node\GetAttrExpressionDecorator::twigGetAttribute($this->env, $this->source, (isset($context["item"]) || array_key_exists("item", $context) ? $context["item"] : (function () { throw new RuntimeError('Variable "item" does not exist.', 101, $this->source); })()), "label", [], "any", false, false, false, 101), "html", null, true);
  351. }
  352. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  353. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  354. yield from [];
  355. }
  356. // line 3
  357. public function macro_attributes($attributes = null, ...$varargs): string|Markup
  358. {
  359. $macros = $this->macros;
  360. $context = [
  361. "attributes" => $attributes,
  362. "varargs" => $varargs,
  363. ] + $this->env->getGlobals();
  364. $blocks = [];
  365. return ('' === $tmp = \Twig\Extension\CoreExtension::captureOutput((function () use (&$context, $macros, $blocks) {
  366. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  367. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "attributes"));
  368. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  369. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "attributes"));
  370. // line 4
  371. $context['_parent'] = $context;
  372. $context['_seq'] = CoreExtension::ensureTraversable((isset($context["attributes"]) || array_key_exists("attributes", $context) ? $context["attributes"] : (function () { throw new RuntimeError('Variable "attributes" does not exist.', 4, $this->source); })()));
  373. foreach ($context['_seq'] as $context["name"] => $context["value"]) {
  374. // line 5
  375. if (( !(null === $context["value"]) && !($context["value"] === false))) {
  376. // line 6
  377. yield Twig\Extension\CoreExtension::sprintf(" %s=\"%s\"", $context["name"], ((($context["value"] === true)) ? ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["name"])) : ($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["value"]))));
  378. }
  379. }
  380. $_parent = $context['_parent'];
  381. unset($context['_seq'], $context['name'], $context['value'], $context['_parent']);
  382. $context = array_intersect_key($context, $_parent) + $_parent;
  383. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  384. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  385. yield from [];
  386. })())) ? '' : new Markup($tmp, $this->env->getCharset());
  387. }
  388. /**
  389. * @codeCoverageIgnore
  390. */
  391. public function getTemplateName(): string
  392. {
  393. return "knp_menu.html.twig";
  394. }
  395. /**
  396. * @codeCoverageIgnore
  397. */
  398. public function isTraitable(): bool
  399. {
  400. return false;
  401. }
  402. /**
  403. * @codeCoverageIgnore
  404. */
  405. public function getDebugInfo(): array
  406. {
  407. return array ( 451 => 6, 449 => 5, 445 => 4, 427 => 3, 400 => 101, 372 => 99, 342 => 97, 326 => 92, 324 => 91, 322 => 90, 320 => 89, 316 => 86, 312 => 84, 310 => 83, 306 => 82, 303 => 81, 300 => 78, 298 => 77, 296 => 76, 293 => 73, 290 => 72, 287 => 71, 285 => 70, 282 => 69, 279 => 68, 276 => 66, 273 => 64, 271 => 63, 268 => 61, 266 => 60, 263 => 58, 261 => 57, 259 => 56, 257 => 55, 255 => 54, 253 => 52, 240 => 51, 229 => 48, 227 => 47, 210 => 44, 193 => 43, 190 => 41, 188 => 40, 185 => 37, 183 => 36, 181 => 34, 179 => 33, 166 => 31, 151 => 26, 146 => 25, 143 => 24, 141 => 23, 128 => 22, 117 => 19, 115 => 18, 102 => 17, 91 => 12, 85 => 13, 83 => 12, 70 => 11, 47 => 1,);
  408. }
  409. public function getSourceContext(): Source
  410. {
  411. return new Source("{% extends 'knp_menu_base.html.twig' %}
  412. {% macro attributes(attributes) %}
  413. {% for name, value in attributes %}
  414. {%- if value is not none and value is not same as(false) -%}
  415. {{- ' %s=\"%s\"'|format(name, value is same as(true) ? name|e : value|e)|raw -}}
  416. {%- endif -%}
  417. {%- endfor -%}
  418. {% endmacro %}
  419. {% block compressed_root %}
  420. {% apply knp_menu_spaceless %}
  421. {{ block('root') }}
  422. {% endapply %}
  423. {% endblock %}
  424. {% block root %}
  425. {% set listAttributes = item.childrenAttributes %}
  426. {{ block('list') -}}
  427. {% endblock %}
  428. {% block list %}
  429. {% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
  430. {% import _self as knp_menu %}
  431. <ul{{ knp_menu.attributes(listAttributes) }}>
  432. {{ block('children') }}
  433. </ul>
  434. {% endif %}
  435. {% endblock %}
  436. {% block children %}
  437. {# save current variables #}
  438. {% set currentOptions = options %}
  439. {% set currentItem = item %}
  440. {# update the depth for children #}
  441. {% if options.depth is not none %}
  442. {% set options = options|merge({depth: currentOptions.depth - 1}) %}
  443. {% endif %}
  444. {# update the matchingDepth for children #}
  445. {% if options.matchingDepth is not none and options.matchingDepth > 0 %}
  446. {% set options = options|merge({matchingDepth: currentOptions.matchingDepth - 1}) %}
  447. {% endif %}
  448. {% for item in currentItem.children %}
  449. {{ block('item') }}
  450. {% endfor %}
  451. {# restore current variables #}
  452. {% set item = currentItem %}
  453. {% set options = currentOptions %}
  454. {% endblock %}
  455. {% block item %}
  456. {% if item.displayed %}
  457. {# building the class of the item #}
  458. {%- set classes = item.attribute('class') is not empty ? [item.attribute('class')] : [] %}
  459. {%- if matcher.isCurrent(item) %}
  460. {%- set classes = classes|merge([options.currentClass]) %}
  461. {%- elseif matcher.isAncestor(item, options.matchingDepth) %}
  462. {%- set classes = classes|merge([options.ancestorClass]) %}
  463. {%- endif %}
  464. {%- if item.actsLikeFirst %}
  465. {%- set classes = classes|merge([options.firstClass]) %}
  466. {%- endif %}
  467. {%- if item.actsLikeLast %}
  468. {%- set classes = classes|merge([options.lastClass]) %}
  469. {%- endif %}
  470. {# Mark item as \"leaf\" (no children) or as \"branch\" (has children that are displayed) #}
  471. {% if item.hasChildren and options.depth is not same as(0) %}
  472. {% if options.branch_class is not empty and item.displayChildren %}
  473. {%- set classes = classes|merge([options.branch_class]) %}
  474. {% endif %}
  475. {% elseif options.leaf_class is not empty %}
  476. {%- set classes = classes|merge([options.leaf_class]) %}
  477. {%- endif %}
  478. {%- set attributes = item.attributes %}
  479. {%- if classes is not empty %}
  480. {%- set attributes = attributes|merge({class: classes|join(' ')}) %}
  481. {%- endif %}
  482. {# displaying the item #}
  483. {% import _self as knp_menu %}
  484. <li{{ knp_menu.attributes(attributes) }}>
  485. {%- if item.uri is not empty and (not matcher.isCurrent(item) or options.currentAsLink) %}
  486. {{ block('linkElement') }}
  487. {%- else %}
  488. {{ block('spanElement') }}
  489. {%- endif %}
  490. {# render the list of children #}
  491. {%- set childrenClasses = item.childrenAttribute('class') is not empty ? [item.childrenAttribute('class')] : [] %}
  492. {%- set childrenClasses = childrenClasses|merge(['menu_level_' ~ item.level]) %}
  493. {%- set listAttributes = item.childrenAttributes|merge({class: childrenClasses|join(' ')}) %}
  494. {{ block('list') }}
  495. </li>
  496. {% endif %}
  497. {% endblock %}
  498. {% block linkElement %}{% import _self as knp_menu %}<a href=\"{{ item.uri }}\"{{ knp_menu.attributes(item.linkAttributes) }}>{{ block('label') }}</a>{% endblock %}
  499. {% block spanElement %}{% import _self as knp_menu %}<span{{ knp_menu.attributes(item.labelAttributes) }}>{{ block('label') }}</span>{% endblock %}
  500. {% block label %}{% if options.allow_safe_labels and item.getExtra('safe_label', false) %}{{ item.label|raw }}{% else %}{{ item.label }}{% endif %}{% endblock %}
  501. ", "knp_menu.html.twig", "/var/www/vhosts/platformv4.alpha.se7enx.com/httpdocs/platformvlegacy4.alpha.se7enx.com/vendor/knplabs/knp-menu/src/Knp/Menu/Resources/views/knp_menu.html.twig");
  502. }
  503. }