var/cache/dev/twig/52/528fed89783589e1ffc74fff9764f732.php line 141

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. /* front/layout/languages.html.twig */
  16. class __TwigTemplate_ffceef3fad97b18847bbc6f04b27c3ce extends Template
  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->parent = false;
  28. $this->blocks = [
  29. ];
  30. }
  31. protected function doDisplay(array $context, array $blocks = []): iterable
  32. {
  33. $macros = $this->macros;
  34. $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  35. $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/layout/languages.html.twig"));
  36. $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  37. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/layout/languages.html.twig"));
  38. // line 1
  39. yield "<div class=\"languages\">
  40. ";
  41. // line 2
  42. if ((($tmp = !array_key_exists("language", $context)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  43. // line 3
  44. yield " ";
  45. $context["language"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["languageMgr"]) || array_key_exists("languageMgr", $context) ? $context["languageMgr"] : (function () { throw new RuntimeError('Variable "languageMgr" does not exist.', 3, $this->source); })()), "getCurrentLanguage", [], "method", false, false, false, 3);
  46. } else {
  47. // line 5
  48. yield " ";
  49. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["languageMgr"]) || array_key_exists("languageMgr", $context) ? $context["languageMgr"] : (function () { throw new RuntimeError('Variable "languageMgr" does not exist.', 5, $this->source); })()), "switchTo", [(isset($context["language"]) || array_key_exists("language", $context) ? $context["language"] : (function () { throw new RuntimeError('Variable "language" does not exist.', 5, $this->source); })())], "method", false, false, false, 5), "html", null, true);
  50. yield "
  51. ";
  52. }
  53. // line 7
  54. $context["route"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 7, $this->source); })()), "request", [], "any", false, false, false, 7), "attributes", [], "any", false, false, false, 7), "get", ["_route"], "method", false, false, false, 7);
  55. // line 8
  56. $context["params"] = CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 8, $this->source); })()), "request", [], "any", false, false, false, 8), "attributes", [], "any", false, false, false, 8), "get", ["_route_params"], "method", false, false, false, 8);
  57. // line 9
  58. if ((($tmp = (isset($context["params"]) || array_key_exists("params", $context) ? $context["params"] : (function () { throw new RuntimeError('Variable "params" does not exist.', 9, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  59. // line 10
  60. yield " ";
  61. $context['_parent'] = $context;
  62. $context['_seq'] = CoreExtension::ensureTraversable((isset($context["locales"]) || array_key_exists("locales", $context) ? $context["locales"] : (function () { throw new RuntimeError('Variable "locales" does not exist.', 10, $this->source); })()));
  63. $context['loop'] = [
  64. 'parent' => $context['_parent'],
  65. 'index0' => 0,
  66. 'index' => 1,
  67. 'first' => true,
  68. ];
  69. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  70. $length = count($context['_seq']);
  71. $context['loop']['revindex0'] = $length - 1;
  72. $context['loop']['revindex'] = $length;
  73. $context['loop']['length'] = $length;
  74. $context['loop']['last'] = 1 === $length;
  75. }
  76. foreach ($context['_seq'] as $context["_key"] => $context["locale"]) {
  77. // line 11
  78. yield " ";
  79. if ((($tmp = !CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, false, 11)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
  80. yield "|";
  81. }
  82. // line 12
  83. yield " ";
  84. if (($context["locale"] != CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 12, $this->source); })()), "request", [], "any", false, false, false, 12), "locale", [], "any", false, false, false, 12))) {
  85. // line 13
  86. yield " ";
  87. if (((isset($context["route"]) || array_key_exists("route", $context) ? $context["route"] : (function () { throw new RuntimeError('Variable "route" does not exist.', 13, $this->source); })()) == "product")) {
  88. // line 14
  89. yield " ";
  90. $context["descr"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["product"]) || array_key_exists("product", $context) ? $context["product"] : (function () { throw new RuntimeError('Variable "product" does not exist.', 14, $this->source); })()), "getProductDescription", [$context["locale"]], "method", false, false, false, 14);
  91. // line 15
  92. yield " ";
  93. $context["params"] = Twig\Extension\CoreExtension::merge((isset($context["params"]) || array_key_exists("params", $context) ? $context["params"] : (function () { throw new RuntimeError('Variable "params" does not exist.', 15, $this->source); })()), ["_locale" => $context["locale"], "url" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["descr"]) || array_key_exists("descr", $context) ? $context["descr"] : (function () { throw new RuntimeError('Variable "descr" does not exist.', 15, $this->source); })()), "url", [], "any", false, false, false, 15)]);
  94. // line 16
  95. yield " ";
  96. } elseif ((((isset($context["route"]) || array_key_exists("route", $context) ? $context["route"] : (function () { throw new RuntimeError('Variable "route" does not exist.', 16, $this->source); })()) == "category") || ((isset($context["route"]) || array_key_exists("route", $context) ? $context["route"] : (function () { throw new RuntimeError('Variable "route" does not exist.', 16, $this->source); })()) == "universe"))) {
  97. // line 17
  98. yield " ";
  99. $context["descr"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 17, $this->source); })()), "getCategoryDescription", [$context["locale"]], "method", false, false, false, 17);
  100. // line 18
  101. yield " ";
  102. $context["params"] = Twig\Extension\CoreExtension::merge((isset($context["params"]) || array_key_exists("params", $context) ? $context["params"] : (function () { throw new RuntimeError('Variable "params" does not exist.', 18, $this->source); })()), ["_locale" => $context["locale"], "url" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["descr"]) || array_key_exists("descr", $context) ? $context["descr"] : (function () { throw new RuntimeError('Variable "descr" does not exist.', 18, $this->source); })()), "url", [], "any", false, false, false, 18)]);
  103. // line 19
  104. yield " ";
  105. } elseif (((isset($context["route"]) || array_key_exists("route", $context) ? $context["route"] : (function () { throw new RuntimeError('Variable "route" does not exist.', 19, $this->source); })()) == "page")) {
  106. // line 20
  107. yield " ";
  108. $context["descr"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["page"]) || array_key_exists("page", $context) ? $context["page"] : (function () { throw new RuntimeError('Variable "page" does not exist.', 20, $this->source); })()), "getPageDescription", [$context["locale"]], "method", false, false, false, 20);
  109. // line 21
  110. yield " ";
  111. $context["params"] = Twig\Extension\CoreExtension::merge((isset($context["params"]) || array_key_exists("params", $context) ? $context["params"] : (function () { throw new RuntimeError('Variable "params" does not exist.', 21, $this->source); })()), ["_locale" => $context["locale"], "url" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["descr"]) || array_key_exists("descr", $context) ? $context["descr"] : (function () { throw new RuntimeError('Variable "descr" does not exist.', 21, $this->source); })()), "url", [], "any", false, false, false, 21)]);
  112. // line 22
  113. yield " ";
  114. } elseif (((isset($context["route"]) || array_key_exists("route", $context) ? $context["route"] : (function () { throw new RuntimeError('Variable "route" does not exist.', 22, $this->source); })()) == "manufacturer")) {
  115. // line 23
  116. yield " ";
  117. $context["descr"] = CoreExtension::getAttribute($this->env, $this->source, (isset($context["manufacturer"]) || array_key_exists("manufacturer", $context) ? $context["manufacturer"] : (function () { throw new RuntimeError('Variable "manufacturer" does not exist.', 23, $this->source); })()), "getManufacturerDescription", [$context["locale"]], "method", false, false, false, 23);
  118. // line 24
  119. yield " ";
  120. $context["params"] = Twig\Extension\CoreExtension::merge((isset($context["params"]) || array_key_exists("params", $context) ? $context["params"] : (function () { throw new RuntimeError('Variable "params" does not exist.', 24, $this->source); })()), ["_locale" => $context["locale"], "url" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["descr"]) || array_key_exists("descr", $context) ? $context["descr"] : (function () { throw new RuntimeError('Variable "descr" does not exist.', 24, $this->source); })()), "url", [], "any", false, false, false, 24)]);
  121. // line 25
  122. yield " ";
  123. } else {
  124. // line 26
  125. yield " ";
  126. $context["params"] = Twig\Extension\CoreExtension::merge((isset($context["params"]) || array_key_exists("params", $context) ? $context["params"] : (function () { throw new RuntimeError('Variable "params" does not exist.', 26, $this->source); })()), ["_locale" => $context["locale"]]);
  127. // line 27
  128. yield " ";
  129. }
  130. // line 28
  131. yield " ";
  132. $context["redirect"] = $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath((isset($context["route"]) || array_key_exists("route", $context) ? $context["route"] : (function () { throw new RuntimeError('Variable "route" does not exist.', 28, $this->source); })()), (isset($context["params"]) || array_key_exists("params", $context) ? $context["params"] : (function () { throw new RuntimeError('Variable "params" does not exist.', 28, $this->source); })()));
  133. // line 29
  134. yield " <a href=\"";
  135. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["redirect"]) || array_key_exists("redirect", $context) ? $context["redirect"] : (function () { throw new RuntimeError('Variable "redirect" does not exist.', 29, $this->source); })()), "html", null, true);
  136. yield "\" onclick=\"document.location = atob(\x27";
  137. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['App\Twig\TextExtension']->base64Encode($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("change_locale", ["_locale" => $context["locale"], "redirect" => (isset($context["redirect"]) || array_key_exists("redirect", $context) ? $context["redirect"] : (function () { throw new RuntimeError('Variable "redirect" does not exist.', 29, $this->source); })())])), "html", null, true);
  138. yield "\x27); return false;\">";
  139. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["locale"], "html", null, true);
  140. yield "</a>
  141. ";
  142. } else {
  143. // line 31
  144. yield " <span>";
  145. yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["locale"], "html", null, true);
  146. yield "</span>
  147. ";
  148. }
  149. // line 33
  150. yield " ";
  151. ++$context['loop']['index0'];
  152. ++$context['loop']['index'];
  153. $context['loop']['first'] = false;
  154. if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  155. --$context['loop']['revindex0'];
  156. --$context['loop']['revindex'];
  157. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  158. }
  159. }
  160. $_parent = $context['_parent'];
  161. unset($context['_seq'], $context['_key'], $context['locale'], $context['_parent'], $context['loop']);
  162. $context = array_intersect_key($context, $_parent) + $_parent;
  163. }
  164. // line 35
  165. yield "</div>";
  166. $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  167. $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  168. yield from [];
  169. }
  170. /**
  171. * @codeCoverageIgnore
  172. */
  173. public function getTemplateName(): string
  174. {
  175. return "front/layout/languages.html.twig";
  176. }
  177. /**
  178. * @codeCoverageIgnore
  179. */
  180. public function isTraitable(): bool
  181. {
  182. return false;
  183. }
  184. /**
  185. * @codeCoverageIgnore
  186. */
  187. public function getDebugInfo(): array
  188. {
  189. return array ( 174 => 35, 159 => 33, 153 => 31, 143 => 29, 140 => 28, 137 => 27, 134 => 26, 131 => 25, 128 => 24, 125 => 23, 122 => 22, 119 => 21, 116 => 20, 113 => 19, 110 => 18, 107 => 17, 104 => 16, 101 => 15, 98 => 14, 95 => 13, 92 => 12, 87 => 11, 69 => 10, 67 => 9, 65 => 8, 63 => 7, 57 => 5, 53 => 3, 51 => 2, 48 => 1,);
  190. }
  191. public function getSourceContext(): Source
  192. {
  193. return new Source("<div class=\"languages\">
  194. {% if language is not defined %}
  195. {% set language = languageMgr.getCurrentLanguage() %}
  196. {% else %}
  197. {{ languageMgr.switchTo(language) }}
  198. {% endif %}
  199. {% set route = app.request.attributes.get(\x27_route\x27) %}
  200. {% set params = app.request.attributes.get(\x27_route_params\x27) %}
  201. {% if params %}
  202. {% for locale in locales %}
  203. {% if not loop.first %}|{% endif %}
  204. {% if locale != app.request.locale %}
  205. {% if route == \x27product\x27 %}
  206. {% set descr = product.getProductDescription(locale) %}
  207. {% set params = params|merge({\x27_locale\x27: locale, \x27url\x27:descr.url}) %}
  208. {% elseif (route == \x27category\x27) or (route == \x27universe\x27) %}
  209. {% set descr = category.getCategoryDescription(locale) %}
  210. {% set params = params|merge({\x27_locale\x27: locale, \x27url\x27:descr.url}) %}
  211. {% elseif route == \x27page\x27 %}
  212. {% set descr = page.getPageDescription(locale) %}
  213. {% set params = params|merge({\x27_locale\x27: locale, \x27url\x27:descr.url}) %}
  214. {% elseif route == \x27manufacturer\x27 %}
  215. {% set descr = manufacturer.getManufacturerDescription(locale) %}
  216. {% set params = params|merge({\x27_locale\x27: locale, \x27url\x27:descr.url}) %}
  217. {% else %}
  218. {% set params = params|merge({\x27_locale\x27: locale}) %}
  219. {% endif %}
  220. {% set redirect = path(route, params) %}
  221. <a href=\"{{ redirect }}\" onclick=\"document.location = atob(\x27{{ path(\x27change_locale\x27,{_locale:locale,redirect:redirect})|raw|base64_encode }}\x27); return false;\">{{ locale }}</a>
  222. {% else %}
  223. <span>{{ locale }}</span>
  224. {% endif %}
  225. {% endfor %}
  226. {% endif %}
  227. </div>", "front/layout/languages.html.twig", "/var/www/dogcat.com/v2-test/templates/front/layout/languages.html.twig");
  228. }
  229. }