var/cache/dev/twig/d4/d4651c6bb89600373fe813fe05348376d87f22c812a07e54f9cc025b9d4cfeef.php line 34

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. /* themes/ismart/part/social.html.twig */
  15. class __TwigTemplate_49b4a662beb2cc23256d8362c4efa96423938f0b98ff2cef4a9b9a0bca1dbeae extends Template
  16. {
  17.     private $source;
  18.     private $macros = [];
  19.     public function __construct(Environment $env)
  20.     {
  21.         parent::__construct($env);
  22.         $this->source $this->getSourceContext();
  23.         $this->parent false;
  24.         $this->blocks = [
  25.         ];
  26.     }
  27.     protected function doDisplay(array $context, array $blocks = [])
  28.     {
  29.         $macros $this->macros;
  30.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  31.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""themes/ismart/part/social.html.twig"));
  32.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  33.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""themes/ismart/part/social.html.twig"));
  34.         // line 1
  35.         if ((array_key_exists("post"$context) &&  !Twig\Extension\CoreExtension::testEmpty((isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'1$this->source); })())))) {
  36.             // line 2
  37.             $context["social"] = $this->extensions['App\Backend\SocialBundle\Extension\SocialExtension']->getSocialByPost((isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'2$this->source); })()));
  38.             // line 3
  39.             yield "    ";
  40.             $context["googleTitle"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'3$this->source); })()), "title", [], "any"falsefalsefalse3);
  41.             // line 4
  42.             yield "    ";
  43.             $context["googleDescription"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'4$this->source); })()), "description", [], "any"falsefalsefalse4);
  44.             // line 5
  45.             yield "    ";
  46.             $context["googleTags"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'5$this->source); })()), "title", [], "any"falsefalsefalse5);
  47.             // line 6
  48.             yield "    ";
  49.             $context["facebookTitle"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'6$this->source); })()), "title", [], "any"falsefalsefalse6);
  50.             // line 7
  51.             yield "    ";
  52.             $context["facebookDescription"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'7$this->source); })()), "description", [], "any"falsefalsefalse7);
  53.             // line 8
  54.             yield "    ";
  55.             $context["facebookThumbnail"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["post"]) || array_key_exists("post"$context) ? $context["post"] : (function () { throw new RuntimeError('Variable "post" does not exist.'8$this->source); })()), "image", [], "any"falsefalsefalse8);
  56.             // line 9
  57.             yield "
  58.     ";
  59.             // line 10
  60.             if ( !Twig\Extension\CoreExtension::testEmpty((isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'10$this->source); })()))) {
  61.                 // line 11
  62.                 yield "        ";
  63.                 if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'11$this->source); })()), "googleTitle", [], "any"falsefalsefalse11))) {
  64.                     // line 12
  65.                     yield "            ";
  66.                     $context["googleTitle"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'12$this->source); })()), "googleTitle", [], "any"falsefalsefalse12);
  67.                     // line 13
  68.                     yield "        ";
  69.                 }
  70.                 // line 14
  71.                 yield "        ";
  72.                 if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'14$this->source); })()), "googleTag", [], "any"falsefalsefalse14))) {
  73.                     // line 15
  74.                     yield "            ";
  75.                     $context["googleTags"] = Twig\Extension\CoreExtension::join(CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'15$this->source); })()), "googleTag", [], "any"falsefalsefalse15), ",");
  76.                     // line 16
  77.                     yield "        ";
  78.                 }
  79.                 // line 17
  80.                 yield "        ";
  81.                 if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'17$this->source); })()), "googleDescription", [], "any"falsefalsefalse17))) {
  82.                     // line 18
  83.                     yield "            ";
  84.                     $context["googleDescription"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'18$this->source); })()), "googleDescription", [], "any"falsefalsefalse18);
  85.                     // line 19
  86.                     yield "        ";
  87.                 }
  88.                 // line 20
  89.                 yield "        ";
  90.                 if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'20$this->source); })()), "facebookTitle", [], "any"falsefalsefalse20))) {
  91.                     // line 21
  92.                     yield "            ";
  93.                     $context["facebookTitle"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'21$this->source); })()), "facebookTitle", [], "any"falsefalsefalse21);
  94.                     // line 22
  95.                     yield "        ";
  96.                 }
  97.                 // line 23
  98.                 yield "        ";
  99.                 if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'23$this->source); })()), "facebookDescription", [], "any"falsefalsefalse23))) {
  100.                     // line 24
  101.                     yield "            ";
  102.                     $context["facebookDescription"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'24$this->source); })()), "facebookDescription", [], "any"falsefalsefalse24);
  103.                     // line 25
  104.                     yield "        ";
  105.                 }
  106.                 // line 26
  107.                 yield "        ";
  108.                 if ( !Twig\Extension\CoreExtension::testEmpty(CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'26$this->source); })()), "facebookThumbnail", [], "any"falsefalsefalse26))) {
  109.                     // line 27
  110.                     yield "            ";
  111.                     $context["facebookThumbnail"] = CoreExtension::getAttribute($this->env$this->source, (isset($context["social"]) || array_key_exists("social"$context) ? $context["social"] : (function () { throw new RuntimeError('Variable "social" does not exist.'27$this->source); })()), "facebookThumbnail", [], "any"falsefalsefalse27);
  112.                     // line 28
  113.                     yield "        ";
  114.                 }
  115.                 // line 29
  116.                 yield "    ";
  117.             }
  118.             // line 30
  119.             yield "<title>";
  120.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleTitle"]) || array_key_exists("googleTitle"$context) ? $context["googleTitle"] : (function () { throw new RuntimeError('Variable "googleTitle" does not exist.'30$this->source); })()), "html"nulltrue);
  121.             yield "</title>
  122. <meta name=\"title\" content=\"";
  123.             // line 31
  124.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleTitle"]) || array_key_exists("googleTitle"$context) ? $context["googleTitle"] : (function () { throw new RuntimeError('Variable "googleTitle" does not exist.'31$this->source); })()), "html"nulltrue);
  125.             yield "\">
  126. <meta name=\"description\" content=\"";
  127.             // line 33
  128.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleDescription"]) || array_key_exists("googleDescription"$context) ? $context["googleDescription"] : (function () { throw new RuntimeError('Variable "googleDescription" does not exist.'33$this->source); })()), "html"nulltrue);
  129.             yield "\"/>
  130. <meta name=\"keywords\" content=\"";
  131.             // line 35
  132.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["googleTags"]) || array_key_exists("googleTags"$context) ? $context["googleTags"] : (function () { throw new RuntimeError('Variable "googleTags" does not exist.'35$this->source); })()), "html"nulltrue);
  133.             yield "\">
  134. <meta property=\"og:locale\" content=\"";
  135.             // line 37
  136.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'37$this->source); })()), "request", [], "any"falsefalsefalse37), "get", ["_locale"], "method"falsefalsefalse37), "html"nulltrue);
  137.             yield "\">
  138. <meta property=\"og:type\" content=\"website\"/>
  139. <meta property=\"og:title\" content=\"";
  140.             // line 40
  141.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["facebookTitle"]) || array_key_exists("facebookTitle"$context) ? $context["facebookTitle"] : (function () { throw new RuntimeError('Variable "facebookTitle" does not exist.'40$this->source); })()), "html"nulltrue);
  142.             yield "\"/>
  143. <meta property=\"og:description\" content=\"";
  144.             // line 41
  145.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["facebookDescription"]) || array_key_exists("facebookDescription"$context) ? $context["facebookDescription"] : (function () { throw new RuntimeError('Variable "facebookDescription" does not exist.'41$this->source); })()), "html"nulltrue);
  146.             yield "\"/>
  147. <meta property=\"og:image\" content=\"";
  148.             // line 42
  149.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((CoreExtension::getAttribute($this->env$this->source, (isset($context["assets"]) || array_key_exists("assets"$context) ? $context["assets"] : (function () { throw new RuntimeError('Variable "assets" does not exist.'42$this->source); })()), "domain", [], "any"falsefalsefalse42) . (isset($context["facebookThumbnail"]) || array_key_exists("facebookThumbnail"$context) ? $context["facebookThumbnail"] : (function () { throw new RuntimeError('Variable "facebookThumbnail" does not exist.'42$this->source); })())), "html"nulltrue);
  150.             yield "\"/>
  151. ";
  152.         }
  153.         // line 44
  154.         yield "
  155. ";
  156.         // line 45
  157.         if ((array_key_exists("category"$context) &&  !Twig\Extension\CoreExtension::testEmpty((isset($context["category"]) || array_key_exists("category"$context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.'45$this->source); })())))) {
  158.             // line 46
  159.             yield "    <title>";
  160.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source, (isset($context["category"]) || array_key_exists("category"$context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.'46$this->source); })()), "title", [], "any"falsefalsefalse46), "html"nulltrue);
  161.             yield "</title>
  162. ";
  163.         }
  164.         
  165.         $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
  166.         
  167.         $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
  168.         return; yield '';
  169.     }
  170.     /**
  171.      * @codeCoverageIgnore
  172.      */
  173.     public function getTemplateName()
  174.     {
  175.         return "themes/ismart/part/social.html.twig";
  176.     }
  177.     /**
  178.      * @codeCoverageIgnore
  179.      */
  180.     public function isTraitable()
  181.     {
  182.         return false;
  183.     }
  184.     /**
  185.      * @codeCoverageIgnore
  186.      */
  187.     public function getDebugInfo()
  188.     {
  189.         return array (  172 => 46,  170 => 45,  167 => 44,  162 => 42,  158 => 41,  154 => 40,  148 => 37,  143 => 35,  138 => 33,  133 => 31,  128 => 30,  125 => 29,  122 => 28,  119 => 27,  116 => 26,  113 => 25,  110 => 24,  107 => 23,  104 => 22,  101 => 21,  98 => 20,  95 => 19,  92 => 18,  89 => 17,  86 => 16,  83 => 15,  80 => 14,  77 => 13,  74 => 12,  71 => 11,  69 => 10,  66 => 9,  63 => 8,  60 => 7,  57 => 6,  54 => 5,  51 => 4,  48 => 3,  46 => 2,  44 => 1,);
  190.     }
  191.     public function getSourceContext()
  192.     {
  193.         return new Source("{% if post is defined and post is not empty %}
  194. {% set social = getSocialByPost(post) %}
  195.     {% set googleTitle = post.title %}
  196.     {% set googleDescription = post.description %}
  197.     {% set googleTags = post.title %}
  198.     {% set facebookTitle = post.title %}
  199.     {% set facebookDescription = post.description %}
  200.     {% set facebookThumbnail = post.image %}
  201.     {% if social is not empty %}
  202.         {% if social.googleTitle is not empty %}
  203.             {% set googleTitle = social.googleTitle %}
  204.         {% endif %}
  205.         {% if social.googleTag is not empty %}
  206.             {% set googleTags = social.googleTag | join(',') %}
  207.         {% endif %}
  208.         {% if social.googleDescription is not empty %}
  209.             {% set googleDescription = social.googleDescription %}
  210.         {% endif %}
  211.         {% if social.facebookTitle is not empty %}
  212.             {% set facebookTitle = social.facebookTitle %}
  213.         {% endif %}
  214.         {% if social.facebookDescription is not empty %}
  215.             {% set facebookDescription = social.facebookDescription %}
  216.         {% endif %}
  217.         {% if social.facebookThumbnail is not empty %}
  218.             {% set facebookThumbnail = social.facebookThumbnail %}
  219.         {% endif %}
  220.     {% endif %}
  221. <title>{{ googleTitle }}</title>
  222. <meta name=\"title\" content=\"{{ googleTitle }}\">
  223. <meta name=\"description\" content=\"{{ googleDescription }}\"/>
  224. <meta name=\"keywords\" content=\"{{ googleTags }}\">
  225. <meta property=\"og:locale\" content=\"{{ app.request.get(\"_locale\") }}\">
  226. <meta property=\"og:type\" content=\"website\"/>
  227. <meta property=\"og:title\" content=\"{{ facebookTitle }}\"/>
  228. <meta property=\"og:description\" content=\"{{ facebookDescription }}\"/>
  229. <meta property=\"og:image\" content=\"{{ assets.domain ~ facebookThumbnail }}\"/>
  230. {% endif %}
  231. {% if category is defined and category is not empty %}
  232.     <title>{{ category.title }}</title>
  233. {% endif %}""themes/ismart/part/social.html.twig""/home/ismart/web/ismart.edu.vn/public_html/templates/themes/ismart/part/social.html.twig");
  234.     }
  235. }