<?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/cat_img.twig */
class __TwigTemplate_810c94319cedc02983edebc563215daf7d8956ceeb939ef3567519c515a1c668 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 = [
];
$macros["_self"] = $this->macros["_self"] = $this;
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/cat_img.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Block/cat_img.twig"));
// line 10
echo "
";
// line 11
$macros["macros"] = $this->macros["macros"] = $this;
// line 12
echo "
<div class=\"category-head\">
<img src=\"";
// line 14
echo twig_call_macro($macros["macros"], "macro_getCategoryImage", [(isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 14, $this->source); })())], 14, $context, $this->getSourceContext());
echo "\" alt=\"";
echo twig_escape_filter($this->env, 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.', 14, $this->source); })()), "name", [], "any", false, false, false, 14), "html", null, true);
echo "\">
</div>
<div class=\"cat-name-box\">
";
// line 17
if ((isset($context["Category"]) || array_key_exists("Category", $context) ? $context["Category"] : (function () { throw new RuntimeError('Variable "Category" does not exist.', 17, $this->source); })())) {
// line 18
echo " ";
$context['_parent'] = $context;
$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.', 18, $this->source); })()), "path", [], "any", false, false, false, 18));
$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["Path"]) {
// line 19
echo " ";
if (twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 19)) {
// line 20
echo " <div class=\"cat-name-sbox\"><p>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Path"], "name", [], "any", false, false, false, 20), "html", null, true);
echo "</p></div>
";
}
// line 22
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['Path'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 23
echo " ";
}
// line 24
echo "</div>";
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 1
public function macro_getCategoryImage($__category__ = null, ...$__varargs__)
{
$macros = $this->macros;
$context = $this->env->mergeGlobals([
"category" => $__category__,
"varargs" => $__varargs__,
]);
$blocks = [];
ob_start();
try {
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "getCategoryImage"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "macro", "getCategoryImage"));
// line 2
echo " ";
if (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.', 2, $this->source); })()), "category_image", [], "any", false, false, false, 2)) {
// line 3
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(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.', 3, $this->source); })()), "category_image", [], "any", false, false, false, 3)), "save_image"), "html", null, true);
echo "
";
} elseif (twig_get_attribute($this->env, $this->source, // line 4
(isset($context["category"]) || array_key_exists("category", $context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.', 4, $this->source); })()), "Parent", [], "any", false, false, false, 4)) {
// line 5
echo " ";
echo twig_call_macro($macros["_self"], "macro_getCategoryImage", [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.', 5, $this->source); })()), "Parent", [], "any", false, false, false, 5)], 5, $context, $this->getSourceContext());
echo "
";
} else {
// line 7
echo " ";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("/html/user_data/assets/img/headimg.png"), "html", null, true);
echo "
";
}
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
return ('' === $tmp = ob_get_contents()) ? '' : new Markup($tmp, $this->env->getCharset());
} finally {
ob_end_clean();
}
}
public function getTemplateName()
{
return "Block/cat_img.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 152 => 7, 146 => 5, 144 => 4, 139 => 3, 136 => 2, 117 => 1, 107 => 24, 104 => 23, 90 => 22, 84 => 20, 81 => 19, 63 => 18, 61 => 17, 53 => 14, 49 => 12, 47 => 11, 44 => 10,);
}
public function getSourceContext()
{
return new Source("{% macro getCategoryImage(category) %}
{% if category.category_image %}
{{ asset(category.category_image|no_image_product, 'save_image') }}
{% elseif category.Parent %}
{{ _self.getCategoryImage(category.Parent) }}
{% else %}
{{ asset('/html/user_data/assets/img/headimg.png') }}
{% endif %}
{% endmacro %}
{% import _self as macros %}
<div class=\"category-head\">
<img src=\"{{ macros.getCategoryImage(Category) }}\" alt=\"{{ Category.name }}\">
</div>
<div class=\"cat-name-box\">
{% if Category %}
{% for Path in Category.path %}
{% if loop.last %}
<div class=\"cat-name-sbox\"><p>{{ Path.name }}</p></div>
{% endif %}
{% endfor %}
{% endif %}
</div>", "Block/cat_img.twig", "/home/northserver/tcg-mana.com/public_html/app/template/default/Block/cat_img.twig");
}
}