var/cache/dev/twig/45/4596ff47ed1ec9334fe6aaee91de26ce.php line 187

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/recommend_recipe.twig */
  14. class __TwigTemplate_3f1288c33de3e962b4bb6d7894e327e9 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/recommend_recipe.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/recommend_recipe.twig"));
  35.         // line 1
  36.         if (array_key_exists("Product"$context)) {
  37.             // line 2
  38.             echo "  ";
  39.             $context["RecommendRecipe"] = twig_get_attribute($this->env$this->source$this->env->getFunction('repository')->getCallable()("Plugin\\Recipe\\Entity\\Recipe"), "getRecommendRecipe", [=> (isset($context["Product"]) || array_key_exists("Product"$context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.'2$this->source); })())], "method"falsefalsetrue2);
  40.             // line 3
  41.             echo "  ";
  42.             $context["recommend_recipe_style"] = "related-recipe";
  43.         } else {
  44.             // line 5
  45.             echo "  ";
  46.             $context["RecommendRecipe"] = twig_get_attribute($this->env$this->source$this->env->getFunction('repository')->getCallable()("Plugin\\Recipe\\Entity\\Recipe"), "getRecommendRecipe", [], "method"falsefalsetrue5);
  47.             // line 6
  48.             echo "  ";
  49.             $context["recommend_recipe_style"] = "recommend-recipe";
  50.         }
  51.         // line 8
  52.         echo "<link rel=\"stylesheet\" href=\"";
  53.         echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("Recipe/assets/default/css/recipe.css""plugin"), "html"nulltrue);
  54.         echo "\">
  55. <script>
  56. \$(window).on('load', function () {
  57.   //レシピ
  58.   const recipe = new Swiper(\".recipe-swiper\", {
  59.     loop: true,
  60.     slidesPerView: 1,
  61.     breakpoints: {
  62.       769: {
  63.         slidesPerView: 2
  64.       },
  65.       1024: {
  66.         slidesPerView: 3
  67.       }
  68.     },
  69.     spaceBetween: 18,
  70.     autoHeight: true,
  71.     navigation: {
  72.       nextEl: \".p-recipe .swiper-button-next\",
  73.       prevEl: \".p-recipe .swiper-button-prev\",
  74.     },
  75.   });
  76. });
  77. </script>
  78. <section class=\"p-section p-recipe ";
  79.         // line 32
  80.         echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["recommend_recipe_style"]) || array_key_exists("recommend_recipe_style"$context) ? $context["recommend_recipe_style"] : (function () { throw new RuntimeError('Variable "recommend_recipe_style" does not exist.'32$this->source); })()), 32$this->source), "html"nulltrue);
  81.         echo "\">
  82.   <div class=\"inner\">
  83.     ";
  84.         // line 34
  85.         if ((array_key_exists("recommend_recipe_title"$context) &&  !(null === (isset($context["recommend_recipe_title"]) || array_key_exists("recommend_recipe_title"$context) ? $context["recommend_recipe_title"] : (function () { throw new RuntimeError('Variable "recommend_recipe_title" does not exist.'34$this->source); })())))) {
  86.             // line 35
  87.             echo "      <h2 class=\"p-title icon-top\"><span>";
  88.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["recommend_recipe_title"]) || array_key_exists("recommend_recipe_title"$context) ? $context["recommend_recipe_title"] : (function () { throw new RuntimeError('Variable "recommend_recipe_title" does not exist.'35$this->source); })()), 35$this->source), "html"nulltrue);
  89.             echo "</span></h2>
  90.     ";
  91.         } else {
  92.             // line 37
  93.             echo "      <h2 class=\"p-title icon-top\"><span>おすすめレシピ</span></h2>
  94.     ";
  95.         }
  96.         // line 39
  97.         echo "    ";
  98.         if ((array_key_exists("recommend_recipe_text"$context) &&  !(null === (isset($context["recommend_recipe_text"]) || array_key_exists("recommend_recipe_text"$context) ? $context["recommend_recipe_text"] : (function () { throw new RuntimeError('Variable "recommend_recipe_text" does not exist.'39$this->source); })())))) {
  99.             // line 40
  100.             echo "    <p class=\"p-text\">";
  101.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed((isset($context["recommend_recipe_text"]) || array_key_exists("recommend_recipe_text"$context) ? $context["recommend_recipe_text"] : (function () { throw new RuntimeError('Variable "recommend_recipe_text" does not exist.'40$this->source); })()), 40$this->source), "html"nulltrue);
  102.             echo "</p>
  103.     ";
  104.         }
  105.         // line 42
  106.         echo "    <div class=\"recipe-slide\">
  107.       <div class=\"swiper recipe-swiper\">
  108.         <div class=\"swiper-wrapper\">
  109.           ";
  110.         // line 45
  111.         $context['_parent'] = $context;
  112.         $context['_seq'] = twig_ensure_traversable((isset($context["RecommendRecipe"]) || array_key_exists("RecommendRecipe"$context) ? $context["RecommendRecipe"] : (function () { throw new RuntimeError('Variable "RecommendRecipe" does not exist.'45$this->source); })()));
  113.         foreach ($context['_seq'] as $context["_key"] => $context["Recipe"]) {
  114.             // line 46
  115.             echo "          <div class=\"swiper-slide\">
  116.             <div class=\"p-recipe-box\">
  117.               <a href=\"";
  118.             // line 48
  119.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("recipe_detail", ["id" => twig_get_attribute($this->env$this->source$context["Recipe"], "id", [], "any"falsefalsetrue48)]), "html"nulltrue);
  120.             echo "\">
  121.                 <div class=\"recipe-head\">
  122.                   ";
  123.             // line 50
  124.             if (((((            // line 51
  125. array_key_exists("Product"$context) && twig_get_attribute($this->env$this->source,             // line 52
  126. $context["Recipe"], "RecipeBadge", [], "any"truetruetrue52)) && twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,             // line 53
  127. $context["Recipe"], "RecipeBadge", [], "any"falsetruetrue53), "name", [], "any"truetruetrue53)) &&  !(null === twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,             // line 54
  128. $context["Recipe"], "RecipeBadge", [], "any"falsefalsetrue54), "name", [], "any"falsefalsetrue54))) && (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,             // line 55
  129. $context["Recipe"], "RecipeBadge", [], "any"falsefalsetrue55), "filename", [], "any"falsefalsetrue55) != ""))) {
  130.                 // line 56
  131.                 echo "                    <div class=\"recipe-badge\">
  132.                       <img
  133.                           src=\"";
  134.                 // line 58
  135.                 echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["Recipe"], "RecipeBadge", [], "any"falsefalsetrue58), "filename", [], "any"falsefalsetrue58), 58$this->source)), "save_image"), "html"nulltrue);
  136.                 echo "\"
  137.                           alt=\"";
  138.                 // line 59
  139.                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["Recipe"], "RecipeBadge", [], "any"falsefalsetrue59), "name", [], "any"falsefalsetrue59), 59$this->source), "html"nulltrue);
  140.                 echo "\">
  141.                     </div>
  142.                   ";
  143.             }
  144.             // line 62
  145.             echo "                  <img src=\"";
  146.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct($this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Recipe"], "mainListImage", [], "any"falsefalsetrue62), 62$this->source)), "save_image"), "html"nulltrue);
  147.             echo "\" alt=\"\">
  148.                 </div>
  149.                 <div class=\"recipe-body\">
  150.                   <h3 class=\"recipe-name\">";
  151.             // line 65
  152.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Recipe"], "name", [], "any"falsefalsetrue65), 65$this->source), "html"nulltrue);
  153.             echo "</h3>
  154.                   ";
  155.             // line 66
  156.             if ((twig_length_filter($this->envtwig_get_attribute($this->env$this->source$context["Recipe"], "RelatedProducts", [], "any"falsefalsetrue66)) > 0)) {
  157.                 // line 67
  158.                 echo "                  <p class=\"recipe-product\">使用した商品:";
  159.                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source$context["Recipe"], "RelatedProducts", [], "any"falsefalsetrue67), 0, [], "array"falsefalsetrue67), "ChildProduct", [], "any"falsefalsetrue67), "name", [], "any"falsefalsetrue67), 67$this->source), "html"nulltrue);
  160.                 echo "</p>
  161.                   ";
  162.             }
  163.             // line 69
  164.             echo "                  <div class=\"recipe-wrap\">
  165.                     <p class=\"recipe-time\"><span>";
  166.             // line 70
  167.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Recipe"], "minute", [], "any"falsefalsetrue70), 70$this->source), "html"nulltrue);
  168.             echo "</span>分</p>
  169.                     <p class=\"recipe-calorie\"><span>";
  170.             // line 71
  171.             echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["Recipe"], "energy", [], "any"falsefalsetrue71), 71$this->source), "html"nulltrue);
  172.             echo "</span>kcal</p>
  173.                   </div>
  174.                   <ul class=\"recipe-tag-list\">
  175.                     ";
  176.             // line 74
  177.             $context['_parent'] = $context;
  178.             $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["Recipe"], "tags", [], "any"falsefalsetrue74));
  179.             foreach ($context['_seq'] as $context["_key"] => $context["tag"]) {
  180.                 // line 75
  181.                 echo "                    <li class=\"recipe-tag-item\">♯";
  182.                 echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["tag"], "name", [], "any"falsefalsetrue75), 75$this->source), "html"nulltrue);
  183.                 echo "</li>
  184.                     ";
  185.             }
  186.             $_parent $context['_parent'];
  187.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['tag'], $context['_parent'], $context['loop']);
  188.             $context array_intersect_key($context$_parent) + $_parent;
  189.             // line 77
  190.             echo "                  </ul>
  191.                   ";
  192.             // line 78
  193.             if (array_key_exists("Product"$context)) {
  194.                 // line 79
  195.                 echo "                  <ul class=\"material-list\">
  196.                     ";
  197.                 // line 80
  198.                 $context['_parent'] = $context;
  199.                 $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env$this->source$context["Recipe"], "materials", [], "any"falsefalsetrue80));
  200.                 foreach ($context['_seq'] as $context["_key"] => $context["material"]) {
  201.                     // line 81
  202.                     echo "                    <li class=\"material-item\">";
  203.                     echo twig_escape_filter($this->env$this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env$this->source$context["material"], "name", [], "any"falsefalsetrue81), 81$this->source), "html"nulltrue);
  204.                     echo "</li>
  205.                     ";
  206.                 }
  207.                 $_parent $context['_parent'];
  208.                 unset($context['_seq'], $context['_iterated'], $context['_key'], $context['material'], $context['_parent'], $context['loop']);
  209.                 $context array_intersect_key($context$_parent) + $_parent;
  210.                 // line 83
  211.                 echo "                  </ul>
  212.                   ";
  213.             }
  214.             // line 85
  215.             echo "                </div>
  216.               </a>
  217.             </div>
  218.           </div>
  219.           ";
  220.         }
  221.         $_parent $context['_parent'];
  222.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Recipe'], $context['_parent'], $context['loop']);
  223.         $context array_intersect_key($context$_parent) + $_parent;
  224.         // line 90
  225.         echo "        </div>
  226.       </div>
  227.       <div class=\"swiper-button-prev\"></div>
  228.       <div class=\"swiper-button-next\"></div>
  229.     </div>
  230.     ";
  231.         // line 95
  232.         if (( !array_key_exists("Product"$context) || (null === (isset($context["Product"]) || array_key_exists("Product"$context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.'95$this->source); })())))) {
  233.             // line 96
  234.             echo "    <div class=\"p-button orange\"><a href=\"";
  235.             echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("recipe");
  236.             echo "\">もっと見る</a></div>
  237.     ";
  238.         }
  239.         // line 98
  240.         echo "  </div>
  241. </section>
  242. ";
  243.         
  244.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  245.         
  246.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  247.     }
  248.     public function getTemplateName()
  249.     {
  250.         return "Block/recommend_recipe.twig";
  251.     }
  252.     public function isTraitable()
  253.     {
  254.         return false;
  255.     }
  256.     public function getDebugInfo()
  257.     {
  258.         return array (  249 => 98,  243 => 96,  241 => 95,  234 => 90,  224 => 85,  220 => 83,  211 => 81,  207 => 80,  204 => 79,  202 => 78,  199 => 77,  190 => 75,  186 => 74,  180 => 71,  176 => 70,  173 => 69,  167 => 67,  165 => 66,  161 => 65,  154 => 62,  148 => 59,  144 => 58,  140 => 56,  138 => 55,  137 => 54,  136 => 53,  135 => 52,  134 => 51,  133 => 50,  128 => 48,  124 => 46,  120 => 45,  115 => 42,  109 => 40,  106 => 39,  102 => 37,  96 => 35,  94 => 34,  89 => 32,  61 => 8,  57 => 6,  54 => 5,  50 => 3,  47 => 2,  45 => 1,);
  259.     }
  260.     public function getSourceContext()
  261.     {
  262.         return new Source("{% if Product is defined %}
  263.   {% set RecommendRecipe = repository('Plugin\\\\Recipe\\\\Entity\\\\Recipe').getRecommendRecipe(Product) %}
  264.   {% set recommend_recipe_style = 'related-recipe' %}
  265. {% else %}
  266.   {% set RecommendRecipe = repository('Plugin\\\\Recipe\\\\Entity\\\\Recipe').getRecommendRecipe() %}
  267.   {% set recommend_recipe_style = 'recommend-recipe' %}
  268. {% endif %}
  269. <link rel=\"stylesheet\" href=\"{{ asset('Recipe/assets/default/css/recipe.css' , 'plugin') }}\">
  270. <script>
  271. \$(window).on('load', function () {
  272.   //レシピ
  273.   const recipe = new Swiper(\".recipe-swiper\", {
  274.     loop: true,
  275.     slidesPerView: 1,
  276.     breakpoints: {
  277.       769: {
  278.         slidesPerView: 2
  279.       },
  280.       1024: {
  281.         slidesPerView: 3
  282.       }
  283.     },
  284.     spaceBetween: 18,
  285.     autoHeight: true,
  286.     navigation: {
  287.       nextEl: \".p-recipe .swiper-button-next\",
  288.       prevEl: \".p-recipe .swiper-button-prev\",
  289.     },
  290.   });
  291. });
  292. </script>
  293. <section class=\"p-section p-recipe {{ recommend_recipe_style }}\">
  294.   <div class=\"inner\">
  295.     {% if recommend_recipe_title is defined and recommend_recipe_title is not null %}
  296.       <h2 class=\"p-title icon-top\"><span>{{ recommend_recipe_title }}</span></h2>
  297.     {% else %}
  298.       <h2 class=\"p-title icon-top\"><span>おすすめレシピ</span></h2>
  299.     {% endif %}
  300.     {% if recommend_recipe_text is defined and recommend_recipe_text is not null %}
  301.     <p class=\"p-text\">{{ recommend_recipe_text }}</p>
  302.     {% endif %}
  303.     <div class=\"recipe-slide\">
  304.       <div class=\"swiper recipe-swiper\">
  305.         <div class=\"swiper-wrapper\">
  306.           {% for Recipe in RecommendRecipe %}
  307.           <div class=\"swiper-slide\">
  308.             <div class=\"p-recipe-box\">
  309.               <a href=\"{{ url('recipe_detail', {'id': Recipe.id}) }}\">
  310.                 <div class=\"recipe-head\">
  311.                   {% if
  312.                         Product is defined and
  313.                         Recipe.RecipeBadge is defined and
  314.                         Recipe.RecipeBadge.name is defined and
  315.                         Recipe.RecipeBadge.name is not null and
  316.                         Recipe.RecipeBadge.filename != '' %}
  317.                     <div class=\"recipe-badge\">
  318.                       <img
  319.                           src=\"{{ asset(Recipe.RecipeBadge.filename|no_image_product, 'save_image') }}\"
  320.                           alt=\"{{ Recipe.RecipeBadge.name }}\">
  321.                     </div>
  322.                   {% endif %}
  323.                   <img src=\"{{ asset(Recipe.mainListImage|no_image_product, 'save_image') }}\" alt=\"\">
  324.                 </div>
  325.                 <div class=\"recipe-body\">
  326.                   <h3 class=\"recipe-name\">{{ Recipe.name }}</h3>
  327.                   {% if Recipe.RelatedProducts|length > 0 %}
  328.                   <p class=\"recipe-product\">使用した商品:{{ Recipe.RelatedProducts[0].ChildProduct.name }}</p>
  329.                   {% endif %}
  330.                   <div class=\"recipe-wrap\">
  331.                     <p class=\"recipe-time\"><span>{{ Recipe.minute }}</span>分</p>
  332.                     <p class=\"recipe-calorie\"><span>{{ Recipe.energy }}</span>kcal</p>
  333.                   </div>
  334.                   <ul class=\"recipe-tag-list\">
  335.                     {% for tag in Recipe.tags %}
  336.                     <li class=\"recipe-tag-item\">♯{{ tag.name }}</li>
  337.                     {% endfor %}
  338.                   </ul>
  339.                   {% if Product is defined %}
  340.                   <ul class=\"material-list\">
  341.                     {% for material in Recipe.materials %}
  342.                     <li class=\"material-item\">{{ material.name }}</li>
  343.                     {% endfor %}
  344.                   </ul>
  345.                   {% endif %}
  346.                 </div>
  347.               </a>
  348.             </div>
  349.           </div>
  350.           {% endfor %}
  351.         </div>
  352.       </div>
  353.       <div class=\"swiper-button-prev\"></div>
  354.       <div class=\"swiper-button-next\"></div>
  355.     </div>
  356.     {% if Product is not defined or Product is null %}
  357.     <div class=\"p-button orange\"><a href=\"{{ url('recipe') }}\">もっと見る</a></div>
  358.     {% endif %}
  359.   </div>
  360. </section>
  361. ""Block/recommend_recipe.twig""/home/hirota-s.com/public_html/app/template/default/Block/recommend_recipe.twig");
  362.     }
  363.     
  364.     public function checkSecurity()
  365.     {
  366.         static $tags = array("if" => 1"set" => 2"for" => 45);
  367.         static $filters = array("escape" => 8"no_image_product" => 58"length" => 66);
  368.         static $functions = array("repository" => 2"asset" => 8"url" => 48);
  369.         try {
  370.             $this->sandbox->checkSecurity(
  371.                 ['if''set''for'],
  372.                 ['escape''no_image_product''length'],
  373.                 ['repository''asset''url']
  374.             );
  375.         } catch (SecurityError $e) {
  376.             $e->setSourceContext($this->source);
  377.             if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
  378.                 $e->setTemplateLine($tags[$e->getTagName()]);
  379.             } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
  380.                 $e->setTemplateLine($filters[$e->getFilterName()]);
  381.             } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
  382.                 $e->setTemplateLine($functions[$e->getFunctionName()]);
  383.             }
  384.             throw $e;
  385.         }
  386.     }
  387. }