<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* Shop/list/products.html.twig */
class __TwigTemplate_1dbb589f86990a754aa6fd4e27a9336b extends Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
];
$this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
$this->checkSecurity();
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Shop/list/products.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Shop/list/products.html.twig"));
// line 2
$context["viewStyle"] = "list ";
// line 3
$context["isCarousel"] = false;
// line 4
$context["isProductlist"] = true;
// line 5
if (((isset($context["listViewStyle"]) || array_key_exists("listViewStyle", $context) ? $context["listViewStyle"] : (function () { throw new RuntimeError('Variable "listViewStyle" does not exist.', 5, $this->source); })()) == "grid")) {
// line 6
echo " ";
$context["viewStyle"] = "grid ";
}
// line 8
if (((isset($context["isCarousel"]) || array_key_exists("isCarousel", $context) ? $context["isCarousel"] : (function () { throw new RuntimeError('Variable "isCarousel" does not exist.', 8, $this->source); })()) == false)) {
// line 9
echo " ";
}
// line 10
echo " ";
$context['_parent'] = $context;
$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); })()));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["product"]) {
// line 11
echo " ";
$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); })())]));
// line 12
echo " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['product'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 13
echo " ";
if (((isset($context["isCarousel"]) || array_key_exists("isCarousel", $context) ? $context["isCarousel"] : (function () { throw new RuntimeError('Variable "isCarousel" does not exist.', 13, $this->source); })()) == false)) {
// line 14
echo "
";
}
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName()
{
return "Shop/list/products.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable()
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo()
{
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,);
}
public function getSourceContext()
{
return new Source("{# @var \$product \\AppBundle\\Model\\DefaultProduct #}
{% set viewStyle = \"list \" %}
{% set isCarousel = false %}
{% set isProductlist = true %}
{% if listViewStyle == \"grid\" %}
{% set viewStyle = \"grid \" %}
{% endif %}
{% if isCarousel == false %}
{% endif %}
{% for product in products %}
{% include 'Shop/list/product.html.twig' with {'product': product, 'isProductList': isProductlist} %}
{% endfor %}
{% if isCarousel == false %}
{% endif %}
", "Shop/list/products.html.twig", "/var/www/html/templates/Shop/list/products.html.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 2, "if" => 5, "for" => 10, "include" => 11);
static $filters = array();
static $functions = array();
try {
$this->sandbox->checkSecurity(
['set', 'if', 'for', 'include'],
[],
[]
);
} catch (SecurityError $e) {
$e->setSourceContext($this->source);
if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
}
}