<?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;
/* Block/header.twig */
class __TwigTemplate_1c95d03480c58ccd9e805b46ea32cc41 extends \Eccube\Twig\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", "Block/header.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/header.twig"));
// line 1
$context["totalQuantity"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_quantity();
// line 2
$context["Categories"] = twig_get_attribute($this->env, $this->source, $this->env->getFunction('repository')->getCallable()("Eccube\\Entity\\Category"), "getList", [], "method", false, false, true, 2);
// line 3
echo "<header id=\"header\">
<h1>
<a href=\"";
// line 5
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("homepage");
echo "\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/common/logo.svg"), "html", null, true);
echo "\" alt=\"U-ARTS\" class=\"logo\"></a>
</h1>
<p class=\"header_sub_txt\">オーダーメイド鏡販売のユーアーツ</p>
<ul class=\"gnav\">
<li class=\"haschild\">
<a href=\"";
// line 11
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "\">取扱い商品</a>
<div class=\"megamenu\">
";
// line 13
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["Categories"]) || array_key_exists("Categories", $context) ? $context["Categories"] : (function () { throw new RuntimeError('Variable "Categories" does not exist.', 13, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["Category"]) {
// line 14
echo " <ul>
<li>
<a href=\"";
// line 16
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Category"], "id", [], "any", false, false, true, 16), 16, $this->source), "html", null, true);
echo "\">
";
// line 17
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Category"], "name", [], "any", false, false, true, 17), 17, $this->source), "html", null, true);
echo "<span>(";
echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["Category"], "ProductCategories", [], "any", false, false, true, 17), 17, $this->source)), "html", null, true);
echo ")</span>
</a>
</li>
";
// line 20
if ((twig_length_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Category"], "children", [], "any", false, false, true, 20)) > 0)) {
// line 21
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["Category"], "children", [], "any", false, false, true, 21));
foreach ($context['_seq'] as $context["_key"] => $context["ChildCategory"]) {
// line 22
echo " <li>
<a href=\"";
// line 23
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["ChildCategory"], "id", [], "any", false, false, true, 23), 23, $this->source), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["ChildCategory"], "name", [], "any", false, false, true, 23), 23, $this->source), "html", null, true);
echo "<span>(";
echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, $context["ChildCategory"], "ProductCategories", [], "any", false, false, true, 23), 23, $this->source)), "html", null, true);
echo ")</span></a>
</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ChildCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 26
echo " ";
}
// line 27
echo " </ul>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 29
echo " </div>
</li>
<li><a href=\"";
// line 31
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("user_data", ["route" => "order_mirror"]);
echo "\">オーダーメイド鏡とは</a></li>
<li><a href=\"";
// line 32
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("user_data", ["route" => "setting"]);
echo "\">鏡の取り付け方</a></li>
<li><a href=\"";
// line 33
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("user_data", ["route" => "faq"]);
echo "\">Q&A</a></li>
<li><a href=\"";
// line 34
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("help_about");
echo "\">ユーアーツについて</a></li>
<li class=\"icon mail\">
<a href=\"";
// line 36
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("contact");
echo "\">
<img src=\"";
// line 37
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/mail.svg"), "html", null, true);
echo "\" alt=\"メールアイコン\">
</a>
</li>
<li class=\"icon cart\">
<a href=\"";
// line 41
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\">
<img src=\"";
// line 42
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/cart.svg"), "html", null, true);
echo "\" alt=\"カートアイコン\">
<span class=\"ec-cartNavi__badge\">";
// line 43
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["totalQuantity"]) || array_key_exists("totalQuantity", $context) ? $context["totalQuantity"] : (function () { throw new RuntimeError('Variable "totalQuantity" does not exist.', 43, $this->source); })()), 43, $this->source), "html", null, true);
echo "</span>
</a>
</li>
</ul>
</header>
<ul class=\"sp_menu\">
<li id=\"nav_toggle\">
<div>
<span class=\"border\"></span>
<span class=\"border\"></span>
<span class=\"border\"></span>
</div>
<span class=\"txt\">Menu</span>
</li>
";
// line 58
if ($this->extensions['Symfony\Bridge\Twig\Extension\SecurityExtension']->isGranted("ROLE_USER")) {
// line 59
echo " <li><a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("logout");
echo "\">
<img src=\"";
// line 60
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/login.svg"), "html", null, true);
echo "\" alt=\"Logoutアイコン\">
<span>Logout</span>
</a>
</li>
";
} else {
// line 65
echo " <li>
<a href=\"";
// line 66
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("mypage_login");
echo "\">
<img src=\"";
// line 67
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/login.svg"), "html", null, true);
echo "\" alt=\"Loginアイコン\">
<span>Login</span>
</a>
</li>
";
}
// line 72
echo " <li><a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("mypage");
echo "\">
<img src=\"";
// line 73
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/mypage.svg"), "html", null, true);
echo "\" alt=\"My pageアイコン\">
<span>My page</span>
</a>
</li>
<li><a href=\"";
// line 78
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("contact");
echo "\">
<img src=\"";
// line 79
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/mail.svg"), "html", null, true);
echo "\" alt=\"Contactアイコン\">
<span>Contact</span>
</a>
</li>
<li><a href=\"";
// line 83
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\">
<span class=\"ec-cartNavi__badge\">";
// line 84
echo twig_escape_filter($this->env, $this->sandbox->ensureToStringAllowed((isset($context["totalQuantity"]) || array_key_exists("totalQuantity", $context) ? $context["totalQuantity"] : (function () { throw new RuntimeError('Variable "totalQuantity" does not exist.', 84, $this->source); })()), 84, $this->source), "html", null, true);
echo "</span>
<img src=\"";
// line 85
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/img/icon/cart.svg"), "html", null, true);
echo "\" alt=\"Cartアイコン\">
<span>Cart</span>
</a>
</li>
</ul>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
public function getTemplateName()
{
return "Block/header.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 246 => 85, 242 => 84, 238 => 83, 231 => 79, 227 => 78, 219 => 73, 214 => 72, 206 => 67, 202 => 66, 199 => 65, 191 => 60, 186 => 59, 184 => 58, 166 => 43, 162 => 42, 158 => 41, 151 => 37, 147 => 36, 142 => 34, 138 => 33, 134 => 32, 130 => 31, 126 => 29, 119 => 27, 116 => 26, 101 => 23, 98 => 22, 93 => 21, 91 => 20, 83 => 17, 77 => 16, 73 => 14, 69 => 13, 64 => 11, 53 => 5, 49 => 3, 47 => 2, 45 => 1,);
}
public function getSourceContext()
{
return new Source("{% set totalQuantity = get_carts_total_quantity() %}
{% set Categories = repository('Eccube\\\\Entity\\\\Category').getList() %}
<header id=\"header\">
<h1>
<a href=\"{{ url('homepage') }}\"><img src=\"{{ asset('assets/img/common/logo.svg') }}\" alt=\"U-ARTS\" class=\"logo\"></a>
</h1>
<p class=\"header_sub_txt\">オーダーメイド鏡販売のユーアーツ</p>
<ul class=\"gnav\">
<li class=\"haschild\">
<a href=\"{{ url('product_list') }}\">取扱い商品</a>
<div class=\"megamenu\">
{% for Category in Categories %}
<ul>
<li>
<a href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">
{{ Category.name }}<span>({{ Category.ProductCategories|length}})</span>
</a>
</li>
{% if Category.children|length > 0 %}
{% for ChildCategory in Category.children %}
<li>
<a href=\"{{ url('product_list') }}?category_id={{ ChildCategory.id }}\">{{ ChildCategory.name }}<span>({{ ChildCategory.ProductCategories|length}})</span></a>
</li>
{% endfor %}
{% endif %}
</ul>
{% endfor %}
</div>
</li>
<li><a href=\"{{ url('user_data', {'route': 'order_mirror'}) }}\">オーダーメイド鏡とは</a></li>
<li><a href=\"{{ url('user_data', {'route': 'setting'}) }}\">鏡の取り付け方</a></li>
<li><a href=\"{{ url('user_data', {'route': 'faq'}) }}\">Q&A</a></li>
<li><a href=\"{{ url('help_about') }}\">ユーアーツについて</a></li>
<li class=\"icon mail\">
<a href=\"{{ url('contact') }}\">
<img src=\"{{ asset('assets/img/icon/mail.svg') }}\" alt=\"メールアイコン\">
</a>
</li>
<li class=\"icon cart\">
<a href=\"{{ url('cart') }}\">
<img src=\"{{ asset('assets/img/icon/cart.svg') }}\" alt=\"カートアイコン\">
<span class=\"ec-cartNavi__badge\">{{totalQuantity}}</span>
</a>
</li>
</ul>
</header>
<ul class=\"sp_menu\">
<li id=\"nav_toggle\">
<div>
<span class=\"border\"></span>
<span class=\"border\"></span>
<span class=\"border\"></span>
</div>
<span class=\"txt\">Menu</span>
</li>
{% if is_granted('ROLE_USER') %}
<li><a href=\"{{ url('logout') }}\">
<img src=\"{{ asset('assets/img/icon/login.svg') }}\" alt=\"Logoutアイコン\">
<span>Logout</span>
</a>
</li>
{% else %}
<li>
<a href=\"{{ url('mypage_login') }}\">
<img src=\"{{ asset('assets/img/icon/login.svg') }}\" alt=\"Loginアイコン\">
<span>Login</span>
</a>
</li>
{% endif %}
<li><a href=\"{{ url('mypage') }}\">
<img src=\"{{ asset('assets/img/icon/mypage.svg') }}\" alt=\"My pageアイコン\">
<span>My page</span>
</a>
</li>
<li><a href=\"{{ url('contact') }}\">
<img src=\"{{ asset('assets/img/icon/mail.svg') }}\" alt=\"Contactアイコン\">
<span>Contact</span>
</a>
</li>
<li><a href=\"{{ url('cart') }}\">
<span class=\"ec-cartNavi__badge\">{{totalQuantity}}</span>
<img src=\"{{ asset('assets/img/icon/cart.svg') }}\" alt=\"Cartアイコン\">
<span>Cart</span>
</a>
</li>
</ul>
", "Block/header.twig", "/home/hr67ekh16/u-arts-mirror.jp/public_html/app/template/uarts/Block/header.twig");
}
public function checkSecurity()
{
static $tags = array("set" => 1, "for" => 13, "if" => 20);
static $filters = array("escape" => 5, "length" => 17);
static $functions = array("get_carts_total_quantity" => 1, "repository" => 2, "url" => 5, "asset" => 5, "is_granted" => 58);
try {
$this->sandbox->checkSecurity(
['set', 'for', 'if'],
['escape', 'length'],
['get_carts_total_quantity', 'repository', 'url', 'asset', 'is_granted']
);
} 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;
}
}
}