var/cache/dev/twig/81/8170cbe4c1f0180b0e51e37ca416d8ad.php line 45

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. /* Block/category_nav_pc.twig */
  14. class __TwigTemplate_75c65377bf9c641cacea7ec6eabf43a1 extends \Eccube\Twig\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""Block/category_nav_pc.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""Block/category_nav_pc.twig"));
  35.         // line 11
  36.         $context["Categories"] = twig_get_attribute($this->env$this->source$this->env->getFunction('repository')->getCallable()("Eccube\\Entity\\Category"), "getList", [], "method"falsefalsetrue11);
  37.         // line 12
  38.         echo "
  39. ";
  40.         // line 28
  41.         echo "
  42. ";
  43.         // line 30
  44.         $macros["__internal_parse_1"] = $this->macros["__internal_parse_1"] = $this;
  45.         // line 31
  46.         echo "
  47. <div class=\"ec-categoryNaviRole\">
  48.     <div class=\"ec-itemNav list_right\">
  49.         <ul class=\"ec-itemNav__nav\">
  50.             ";
  51.         // line 35
  52.         $context['_parent'] = $context;
  53.         $context['_seq'] = twig_ensure_traversable((isset($context["Categories"]) || array_key_exists("Categories"$context) ? $context["Categories"] : (function () { throw new RuntimeError('Variable "Categories" does not exist.'35$this->source); })()));
  54.         foreach ($context['_seq'] as $context["_key"] => $context["ProCategory"]) {
  55.             // line 36
  56.             echo "                ";
  57.             if ((twig_get_attribute($this->env$this->source$context["ProCategory"], "id", [], "any"falsefalsetrue36) == 1)) {
  58.                 // line 37
  59.                 echo "                    <li>
  60.                         <a href=\"";
  61.                 // line 38
  62.                 echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
  63.                 echo "\">";
  64.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品一覧"), "html"nulltrue);
  65.                 echo "</a>
  66.                     </li>
  67.                     ";
  68.                 // line 40
  69.                 $context['_parent'] = $context;
  70.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["ProCategory"], "children", [], "any"falsefalsetrue40));
  71.                 foreach ($context['_seq'] as $context["_key"] => $context["Category"]) {
  72.                     // line 41
  73.                     echo "                        <li>
  74.                             ";
  75.                     // line 42
  76.                     echo twig_call_macro($macros["__internal_parse_1"], "macro_tree", [$context["Category"]], 42$context$this->getSourceContext());
  77.                     echo "
  78.                         </li>
  79.                     ";
  80.                 }
  81.                 $_parent $context['_parent'];
  82.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Category'], $context['_parent'], $context['loop']);
  83.                 $context array_intersect_key($context$_parent) + $_parent;
  84.                 // line 45
  85.                 echo "                ";
  86.             }
  87.             // line 46
  88.             echo "            ";
  89.         }
  90.         $_parent $context['_parent'];
  91.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProCategory'], $context['_parent'], $context['loop']);
  92.         $context array_intersect_key($context$_parent) + $_parent;
  93.         // line 47
  94.         echo "        </ul>
  95.     </div>
  96. </div>";
  97.         
  98.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  99.         
  100.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  101.     }
  102.     // line 13
  103.     public function macro_tree($__Category__ null, ...$__varargs__)
  104.     {
  105.         $macros $this->macros;
  106.         $context $this->env->mergeGlobals([
  107.             "Category" => $__Category__,
  108.             "varargs" => $__varargs__,
  109.         ]);
  110.         $blocks = [];
  111.         ob_start();
  112.         try {
  113.             $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  114.             $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro""tree"));
  115.             $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  116.             $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro""tree"));
  117.             // line 14
  118.             echo "    ";
  119.             $macros["__internal_parse_0"] = $this;
  120.             // line 15
  121.             echo "    <a href=\"";
  122.             echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
  123.             echo "?category_id=";
  124.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["Category"]) || array_key_exists("Category"$context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.'15$this->source); })()), "id", [], "any"falsefalsetrue15), 15$this->source), "html"nulltrue);
  125.             echo "\">
  126.         ";
  127.             // line 16
  128.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source, (isset($context["Category"]) || array_key_exists("Category"$context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.'16$this->source); })()), "name", [], "any"falsefalsetrue16), 16$this->source), "html"nulltrue);
  129.             echo "
  130.     </a>
  131.     ";
  132.             // line 18
  133.             if ((twig_length_filter($this->envtwig_get_attribute($this->env$this->source, (isset($context["Category"]) || array_key_exists("Category"$context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.'18$this->source); })()), "children", [], "any"falsefalsetrue18)) > 0)) {
  134.                 // line 19
  135.                 echo "        <ul>
  136.             ";
  137.                 // line 20
  138.                 $context['_parent'] = $context;
  139.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source, (isset($context["Category"]) || array_key_exists("Category"$context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.'20$this->source); })()), "children", [], "any"falsefalsetrue20));
  140.                 foreach ($context['_seq'] as $context["_key"] => $context["ChildCategory"]) {
  141.                     // line 21
  142.                     echo "                <li>
  143.                     ";
  144.                     // line 22
  145.                     echo twig_call_macro($macros["__internal_parse_0"], "macro_tree", [$context["ChildCategory"]], 22$context$this->getSourceContext());
  146.                     echo "
  147.                 </li>
  148.             ";
  149.                 }
  150.                 $_parent $context['_parent'];
  151.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ChildCategory'], $context['_parent'], $context['loop']);
  152.                 $context array_intersect_key($context$_parent) + $_parent;
  153.                 // line 25
  154.                 echo "        </ul>
  155.     ";
  156.             }
  157.             
  158.             $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  159.             
  160.             $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  161.             return ('' === $tmp ob_get_contents()) ? '' : new Markup($tmp$this->env->getCharset());
  162.         } finally {
  163.             ob_end_clean();
  164.         }
  165.     }
  166.     public function getTemplateName()
  167.     {
  168.         return "Block/category_nav_pc.twig";
  169.     }
  170.     public function isTraitable()
  171.     {
  172.         return false;
  173.     }
  174.     public function getDebugInfo()
  175.     {
  176.         return array (  170 => 25,  161 => 22,  158 => 21,  154 => 20,  151 => 19,  149 => 18,  144 => 16,  137 => 15,  134 => 14,  115 => 13,  103 => 47,  97 => 46,  94 => 45,  85 => 42,  82 => 41,  78 => 40,  71 => 38,  68 => 37,  65 => 36,  61 => 35,  55 => 31,  53 => 30,  50 => 28,  47 => 12,  45 => 11,);
  177.     }
  178.     public function getSourceContext()
  179.     {
  180.         return new Source("{#
  181. This file is part of EC-CUBE
  182. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  183. http://www.ec-cube.co.jp/
  184. For the full copyright and license information, please view the LICENSE
  185. file that was distributed with this source code.
  186. #}
  187. {% set Categories = repository('Eccube\\\\Entity\\\\Category').getList() %}
  188. {% macro tree(Category) %}
  189.     {% from _self import tree %}
  190.     <a href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">
  191.         {{ Category.name }}
  192.     </a>
  193.     {% if Category.children|length > 0 %}
  194.         <ul>
  195.             {% for ChildCategory in Category.children %}
  196.                 <li>
  197.                     {{ tree(ChildCategory) }}
  198.                 </li>
  199.             {% endfor %}
  200.         </ul>
  201.     {% endif %}
  202. {% endmacro %}
  203. {# @see https://github.com/bolt/bolt/pull/2388 #}
  204. {% from _self import tree %}
  205. <div class=\"ec-categoryNaviRole\">
  206.     <div class=\"ec-itemNav list_right\">
  207.         <ul class=\"ec-itemNav__nav\">
  208.             {% for ProCategory in Categories %}
  209.                 {% if ProCategory.id == 1 %}
  210.                     <li>
  211.                         <a href=\"{{ url('product_list') }}\">{{ '商品一覧'|trans }}</a>
  212.                     </li>
  213.                     {% for Category in ProCategory.children %}
  214.                         <li>
  215.                             {{ tree(Category) }}
  216.                         </li>
  217.                     {% endfor %}
  218.                 {% endif %}
  219.             {% endfor %}
  220.         </ul>
  221.     </div>
  222. </div>""Block/category_nav_pc.twig""/home/xs031638/hieiyuba.xyz/public_html/pro/app/template/default/Block/category_nav_pc.twig");
  223.     }
  224.     
  225.     public function checkSecurity()
  226.     {
  227.         static $tags = array("set" => 11"from" => 30"for" => 35"if" => 36"macro" => 13);
  228.         static $filters = array("escape" => 38"trans" => 38"length" => 18);
  229.         static $functions = array("repository" => 11"url" => 38);
  230.         try {
  231.             $this->sandbox->checkSecurity(
  232.                 ['set''from''for''if''macro'],
  233.                 ['escape''trans''length'],
  234.                 ['repository''url']
  235.             );
  236.         } catch (SecurityError $e) {
  237.             $e->setSourceContext($this->source);
  238.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  239.                 $e->setTemplateLine($tags[$e->getTagName()]);
  240.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  241.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  242.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  243.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  244.             }
  245.             throw $e;
  246.         }
  247.     }
  248. }