var/cache/dev/twig/bb/bbc7318a638cd58b479f749627ce8529.php line 81

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* Shop/list/products.html.twig */
  14. class __TwigTemplate_1dbb589f86990a754aa6fd4e27a9336b extends Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.         ];
  25.         $this->sandbox $this->env->getExtension('\Twig\Extension\SandboxExtension');
  26.         $this->checkSecurity();
  27.     }
  28.     protected function doDisplay(array $context, array $blocks = [])
  29.     {
  30.         $macros $this->macros;
  31.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  32.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Shop/list/products.html.twig"));
  33.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  34.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""Shop/list/products.html.twig"));
  35.         // line 2
  36.         $context["viewStyle"] = "list ";
  37.         // line 3
  38.         $context["isCarousel"] = false;
  39.         // line 4
  40.         $context["isProductlist"] = true;
  41.         // line 5
  42.         if (((isset($context["listViewStyle"]) || array_key_exists("listViewStyle"$context) ? $context["listViewStyle"] : (function () { throw new RuntimeError('Variable "listViewStyle" does not exist.'5$this->source); })()) == "grid")) {
  43.             // line 6
  44.             echo "    ";
  45.             $context["viewStyle"] = "grid ";
  46.         }
  47.         // line 8
  48.         if (((isset($context["isCarousel"]) || array_key_exists("isCarousel"$context) ? $context["isCarousel"] : (function () { throw new RuntimeError('Variable "isCarousel" does not exist.'8$this->source); })()) == false)) {
  49.             // line 9
  50.             echo "    ";
  51.         }
  52.         // line 10
  53.         echo "    ";
  54.         $context['_parent'] = $context;
  55.         $context['_seq'] = twig_ensure_traversable((isset($context["products"]) || array_key_exists("products"$context) ? $context["products"] : (function () { throw new RuntimeError('Variable "products" does not exist.'10$this->source); })()));
  56.         $context['loop'] = [
  57.           'parent' => $context['_parent'],
  58.           'index0' => 0,
  59.           'index'  => 1,
  60.           'first'  => true,
  61.         ];
  62.         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  63.             $length count($context['_seq']);
  64.             $context['loop']['revindex0'] = $length 1;
  65.             $context['loop']['revindex'] = $length;
  66.             $context['loop']['length'] = $length;
  67.             $context['loop']['last'] = === $length;
  68.         }
  69.         foreach ($context['_seq'] as $context["_key"] => $context["product"]) {
  70.             // line 11
  71.             echo "        ";
  72.             $this->loadTemplate("Shop/list/product.html.twig""Shop/list/products.html.twig"11)->display(twig_array_merge($context, ["product" => $context["product"], "isProductList" => (isset($context["isProductlist"]) || array_key_exists("isProductlist"$context) ? $context["isProductlist"] : (function () { throw new RuntimeError('Variable "isProductlist" does not exist.'11$this->source); })())]));
  73.             // line 12
  74.             echo "    ";
  75.             ++$context['loop']['index0'];
  76.             ++$context['loop']['index'];
  77.             $context['loop']['first'] = false;
  78.             if (isset($context['loop']['length'])) {
  79.                 --$context['loop']['revindex0'];
  80.                 --$context['loop']['revindex'];
  81.                 $context['loop']['last'] = === $context['loop']['revindex0'];
  82.             }
  83.         }
  84.         $_parent $context['_parent'];
  85.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['product'], $context['_parent'], $context['loop']);
  86.         $context array_intersect_key($context$_parent) + $_parent;
  87.         // line 13
  88.         echo "    ";
  89.         if (((isset($context["isCarousel"]) || array_key_exists("isCarousel"$context) ? $context["isCarousel"] : (function () { throw new RuntimeError('Variable "isCarousel" does not exist.'13$this->source); })()) == false)) {
  90.             // line 14
  91.             echo "
  92. ";
  93.         }
  94.         
  95.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  96.         
  97.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  98.     }
  99.     /**
  100.      * @codeCoverageIgnore
  101.      */
  102.     public function getTemplateName()
  103.     {
  104.         return "Shop/list/products.html.twig";
  105.     }
  106.     /**
  107.      * @codeCoverageIgnore
  108.      */
  109.     public function isTraitable()
  110.     {
  111.         return false;
  112.     }
  113.     /**
  114.      * @codeCoverageIgnore
  115.      */
  116.     public function getDebugInfo()
  117.     {
  118.         return array (  100 => 14,  97 => 13,  83 => 12,  80 => 11,  62 => 10,  59 => 9,  57 => 8,  53 => 6,  51 => 5,  49 => 4,  47 => 3,  45 => 2,);
  119.     }
  120.     public function getSourceContext()
  121.     {
  122.         return new Source("{# @var \$product \\AppBundle\\Model\\DefaultProduct #}
  123. {% set viewStyle = \"list \" %}
  124. {% set isCarousel = false %}
  125. {% set isProductlist = true %}
  126. {% if listViewStyle == \"grid\" %}
  127.     {%  set viewStyle = \"grid \" %}
  128. {%  endif %}
  129. {% if isCarousel == false %}
  130.     {% endif %}
  131.     {% for product in products %}
  132.         {% include 'Shop/list/product.html.twig' with {'product': product, 'isProductList': isProductlist} %}
  133.     {% endfor %}
  134.     {% if isCarousel == false %}
  135. {% endif %}
  136. ""Shop/list/products.html.twig""/var/www/html/templates/Shop/list/products.html.twig");
  137.     }
  138.     
  139.     public function checkSecurity()
  140.     {
  141.         static $tags = array("set" => 2"if" => 5"for" => 10"include" => 11);
  142.         static $filters = array();
  143.         static $functions = array();
  144.         try {
  145.             $this->sandbox->checkSecurity(
  146.                 ['set''if''for''include'],
  147.                 [],
  148.                 []
  149.             );
  150.         } catch (SecurityError $e) {
  151.             $e->setSourceContext($this->source);
  152.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  153.                 $e->setTemplateLine($tags[$e->getTagName()]);
  154.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  155.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  156.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  157.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  158.             }
  159.             throw $e;
  160.         }
  161.     }
  162. }