• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP twig_first函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中twig_first函数的典型用法代码示例。如果您正苦于以下问题:PHP twig_first函数的具体用法?PHP twig_first怎么用?PHP twig_first使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了twig_first函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<div class=\"modular-row callout\">\n    <div class=\"callout-container container\">\n    ";
     // line 3
     $context["image"] = twig_first($this->env, $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "media", array()), "images", array()));
     // line 4
     echo "    ";
     $context["imagelink"] = $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "image_link", array());
     // line 5
     echo "    ";
     if (isset($context["imagelink"]) ? $context["imagelink"] : null) {
         // line 6
         echo "    \t\t<a href=\"";
         echo $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "image_link", array());
         echo "\" target=\"_blank\">\n    ";
     }
     // line 8
     echo "    ";
     if (isset($context["image"]) ? $context["image"] : null) {
         // line 9
         echo "        ";
         echo $this->getAttribute($this->getAttribute(isset($context["image"]) ? $context["image"] : null, "cropResize", array(0 => 400, 1 => 400), "method"), "html", array(0 => "", 1 => "", 2 => "align-" . $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "image_align", array())), "method");
         echo "\n    ";
     }
     // line 11
     echo "    ";
     if (isset($context["imagelink"]) ? $context["imagelink"] : null) {
         // line 12
         echo "    \t\t</a>\n    ";
     }
     // line 14
     echo isset($context["content"]) ? $context["content"] : null;
     echo "\n    <div class=\"clearfix\"></div>\n    </div>\n</div>\n";
 }
开发者ID:anabecker,项目名称:new-website,代码行数:35,代码来源:6e87b65197cb565b8b52adfceb07d0a08adce634b3f82236edc6bb2a6a506bbf.php


示例2: block_page_content

 public function block_page_content($context, array $blocks = array())
 {
     // line 6
     echo "    <div class=\"page-header\">\n        <h1>Namespaces</h1>\n    </div>\n\n    ";
     // line 10
     if (isset($context["namespaces"]) ? $context["namespaces"] : $this->getContext($context, "namespaces")) {
         // line 11
         echo "        <div class=\"namespaces clearfix\">\n            ";
         // line 12
         $context["last_name"] = "";
         // line 13
         echo "            ";
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["namespaces"]) ? $context["namespaces"] : $this->getContext($context, "namespaces"));
         foreach ($context['_seq'] as $context["_key"] => $context["namespace"]) {
             // line 14
             echo "                ";
             $context["top_level"] = twig_first($this->env, twig_split_filter($this->env, $context["namespace"], "\\"));
             // line 15
             echo "                ";
             if ((isset($context["top_level"]) ? $context["top_level"] : $this->getContext($context, "top_level")) != (isset($context["last_name"]) ? $context["last_name"] : $this->getContext($context, "last_name"))) {
                 // line 16
                 echo "                    ";
                 if (isset($context["last_name"]) ? $context["last_name"] : $this->getContext($context, "last_name")) {
                     echo "</ul></div>";
                 }
                 // line 17
                 echo "                    <div class=\"namespace-container\">\n                        <h2>";
                 // line 18
                 echo twig_escape_filter($this->env, isset($context["top_level"]) ? $context["top_level"] : $this->getContext($context, "top_level"), "html", null, true);
                 echo "</h2>\n                        <ul>\n                    ";
                 // line 20
                 $context["last_name"] = isset($context["top_level"]) ? $context["top_level"] : $this->getContext($context, "top_level");
                 // line 21
                 echo "                ";
             }
             // line 22
             echo "                <li><a href=\"";
             echo twig_escape_filter($this->env, $this->env->getExtension('sami')->pathForNamespace($context, $context["namespace"]), "html", null, true);
             echo "\">";
             echo twig_escape_filter($this->env, $context["namespace"], "html", null, true);
             echo "</a></li>\n            ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['namespace'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 24
         echo "                </ul>\n            </div>\n        </div>\n    ";
     }
     // line 28
     echo "\n";
 }
开发者ID:getgrav,项目名称:grav-api,代码行数:52,代码来源:237c016f72fec75c4c09ac71892ac592985f8515c1ff8386e1539e6929ef.php


示例3: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $__internal_b6577aabed1b59abc2dcd70f6f709dedd4f304b19815695b725d60aefbbe37c3 = $this->env->getExtension("native_profiler");
     $__internal_b6577aabed1b59abc2dcd70f6f709dedd4f304b19815695b725d60aefbbe37c3->enter($__internal_b6577aabed1b59abc2dcd70f6f709dedd4f304b19815695b725d60aefbbe37c3_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@EasyAdmin/default/layout.html.twig"));
     // line 1
     echo "<!DOCTYPE html>\n<html lang=\"";
     // line 2
     echo twig_escape_filter($this->env, _twig_default_filter(twig_first($this->env, twig_split_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["app"]) ? $context["app"] : $this->getContext($context, "app"), "request", array()), "locale", array()), "_")), "en"), "html", null, true);
     echo "\">\n    <head>\n        <meta charset=\"utf-8\">\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n        <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n        <meta name=\"generator\" content=\"EasyAdmin\" />\n\n        <title>";
     // line 10
     $this->displayBlock('page_title', $context, $blocks);
     echo "</title>\n\n        ";
     // line 12
     $this->displayBlock('head_stylesheets', $context, $blocks);
     // line 17
     echo "\n        ";
     // line 18
     $context['_parent'] = $context;
     $context['_seq'] = twig_ensure_traversable($this->env->getExtension('easyadmin_extension')->getBackendConfiguration("design.assets.css"));
     foreach ($context['_seq'] as $context["_key"] => $context["css_asset"]) {
         // line 19
         echo "            <link rel=\"stylesheet\" href=\"";
         echo twig_escape_filter($this->env, $this->env->getExtension('asset')->getAssetUrl($context["css_asset"]), "html", null, true);
         echo "\">\n        ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['css_asset'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 21
     echo "\n        ";
     // line 22
     $this->displayBlock('head_favicon', $context, $blocks);
     // line 26
     echo "\n        ";
     // line 27
     $this->displayBlock('head_javascript', $context, $blocks);
     // line 28
     echo "    </head>\n\n    ";
     // line 30
     $this->displayBlock('body', $context, $blocks);
     // line 129
     echo "</html>\n";
     $__internal_b6577aabed1b59abc2dcd70f6f709dedd4f304b19815695b725d60aefbbe37c3->leave($__internal_b6577aabed1b59abc2dcd70f6f709dedd4f304b19815695b725d60aefbbe37c3_prof);
 }
开发者ID:3lolo,项目名称:lr_app,代码行数:44,代码来源:f773ee60405ccbd59b8d6c4e9c9fac8e905b1305897622e64de1a588e0315641.php


示例4: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     $context["showcase_image"] = twig_first($this->env, $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "media", array()), "images", array()));
     // line 2
     if (isset($context["showcase_image"]) ? $context["showcase_image"] : null) {
         // line 3
         echo "\t<div class=\"modular-row showcase flush-top\" style=\"background-image: url(";
         echo $this->getAttribute(isset($context["showcase_image"]) ? $context["showcase_image"] : null, "url", array());
         echo ");\">\n";
     } else {
         // line 5
         echo "<div class=\"modular-row showcase\">\n";
     }
     // line 7
     echo "    ";
     echo isset($context["content"]) ? $context["content"] : null;
     echo "\n\n    ";
     // line 9
     $context['_parent'] = $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "buttons", array()));
     foreach ($context['_seq'] as $context["_key"] => $context["button"]) {
         // line 10
         echo "        <a class=\"button";
         if ($this->getAttribute($context["button"], "primary", array())) {
             echo " primary";
         }
         echo "\" href=\"";
         echo $this->getAttribute($context["button"], "url", array());
         echo "\">";
         echo $this->getAttribute($context["button"], "text", array());
         echo "</a>\n    ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['button'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 12
     echo "\n</div>\n";
 }
开发者ID:anabecker,项目名称:new-website,代码行数:39,代码来源:2c556852a95e6ac8605d54eef5dd5a1612d151bcc98c46b19631d4c2d8e3488b.php


示例5: getform_tree_details

 public function getform_tree_details($__name__ = null, $__data__ = null, $__forms_by_hash__ = null, ...$__varargs__)
 {
     $context = $this->env->mergeGlobals(array("name" => $__name__, "data" => $__data__, "forms_by_hash" => $__forms_by_hash__, "varargs" => $__varargs__));
     $blocks = array();
     ob_start();
     try {
         $__internal_0379e6e52f2454f68a1477d4851dc64870d86fd5af7017c1bfdf5f6a0dbfea4c = $this->env->getExtension("native_profiler");
         $__internal_0379e6e52f2454f68a1477d4851dc64870d86fd5af7017c1bfdf5f6a0dbfea4c->enter($__internal_0379e6e52f2454f68a1477d4851dc64870d86fd5af7017c1bfdf5f6a0dbfea4c_prof = new Twig_Profiler_Profile($this->getTemplateName(), "macro", "form_tree_details"));
         // line 446
         echo "    ";
         $context["tree"] = $this;
         // line 447
         echo "    <div class=\"tree-details\" ";
         if ($this->getAttribute(isset($context["data"]) ? $context["data"] : null, "id", array(), "any", true, true)) {
             echo " id=\"";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "id", array()), "html", null, true);
             echo "-details\"";
         }
         echo ">\n        <h2>\n            ";
         // line 449
         echo twig_escape_filter($this->env, array_key_exists("name", $context) ? _twig_default_filter(isset($context["name"]) ? $context["name"] : $this->getContext($context, "name"), "(no name)") : "(no name)", "html", null, true);
         echo "\n            ";
         // line 450
         if ($this->getAttribute(isset($context["data"]) ? $context["data"] : null, "type_class", array(), "any", true, true) && $this->getAttribute(isset($context["data"]) ? $context["data"] : null, "type", array(), "any", true, true)) {
             // line 451
             echo "            <span class=\"form-type\">[<abbr title=\"";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "type_class", array()), "html", null, true);
             echo "\">";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "type", array()), "html", null, true);
             echo "</abbr>]</span>\n            ";
         }
         // line 453
         echo "        </h2>\n\n        ";
         // line 455
         if ($this->getAttribute(isset($context["data"]) ? $context["data"] : null, "errors", array(), "any", true, true) && twig_length_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "errors", array())) > 0) {
             // line 456
             echo "        <div class=\"errors\">\n            <h3>\n                <a class=\"toggle-button\" data-toggle-target-id=\"";
             // line 458
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "id", array()), "html", null, true);
             echo "-errors\" href=\"#\">\n                    Errors\n                    <span class=\"toggle-icon\"></span>\n                </a>\n            </h3>\n\n            <table id=\"";
             // line 464
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "id", array()), "html", null, true);
             echo "-errors\">\n                <tr>\n                    <th>Message</th>\n                    <th>Origin</th>\n                    <th>Cause</th>\n                </tr>\n                ";
             // line 470
             $context['_parent'] = $context;
             $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "errors", array()));
             foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
                 // line 471
                 echo "                <tr>\n                    <td>";
                 // line 472
                 echo twig_escape_filter($this->env, $this->getAttribute($context["error"], "message", array()), "html", null, true);
                 echo "</td>\n                    <td>\n                        ";
                 // line 474
                 if (twig_test_empty($this->getAttribute($context["error"], "origin", array()))) {
                     // line 475
                     echo "                            <em>This form.</em>\n                        ";
                 } elseif (!$this->getAttribute(isset($context["forms_by_hash"]) ? $context["forms_by_hash"] : null, $this->getAttribute($context["error"], "origin", array()), array(), "array", true, true)) {
                     // line 477
                     echo "                            <em>Unknown.</em>\n                        ";
                 } else {
                     // line 479
                     echo "                            ";
                     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["forms_by_hash"]) ? $context["forms_by_hash"] : $this->getContext($context, "forms_by_hash"), $this->getAttribute($context["error"], "origin", array()), array(), "array"), "name", array()), "html", null, true);
                     echo "\n                        ";
                 }
                 // line 481
                 echo "                    </td>\n                    <td>\n                        ";
                 // line 483
                 $context['_parent'] = $context;
                 $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["error"], "trace", array()));
                 $context['_iterated'] = false;
                 $context['loop'] = array('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["trace"]) {
                     // line 484
                     echo "                            ";
                     if (!$this->getAttribute($context["loop"], "first", array())) {
                         // line 485
                         echo "                                <br/>Caused by:<br/><br/>\n                            ";
                     }
                     // line 487
                     echo "                            ";
                     if ($this->getAttribute($context["trace"], "root", array(), "any", true, true)) {
                         // line 488
                         echo "                                <strong>";
                         echo twig_escape_filter($this->env, $this->getAttribute($context["trace"], "class", array()), "html", null, true);
                         echo "</strong><br/>\n                                <pre>";
                         // line 490
                         echo twig_escape_filter($this->env, $this->getAttribute($context["trace"], "root", array()), "html", null, true);
                         // line 491
                         if (!twig_test_empty($this->getAttribute($context["trace"], "path", array()))) {
                             // line 492
                             if (twig_first($this->env, $this->getAttribute($context["trace"], "path", array())) != "[") {
                                 echo ".";
//.........这里部分代码省略.........
开发者ID:JerryAimee,项目名称:symfony.github.io,代码行数:101,代码来源:0a025632c78b111b2727410463f905b9b70f8facbfce292e74277097377be34b.php


示例6: block_content

 public function block_content($context, array $blocks = array())
 {
     // line 3
     echo "\n\t\t\t";
     // line 5
     echo "\t\t\t";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "audio", array())) {
         // line 6
         echo "\t\t\t\t<audio autoplay src=\"";
         if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "audio", array()) == "shot") {
             echo $this->env->getExtension('GravTwigExtension')->urlFunc("theme://static/audio/" . $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "audio", array()) . "-" . twig_lower_filter($this->env, twig_first($this->env, $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "slug", array(), "method"))) . ".mp3");
         } else {
             echo $this->env->getExtension('GravTwigExtension')->urlFunc("theme://static/audio/" . $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "audio", array()) . ".mp3");
         }
         echo "\"></audio>\n\t\t\t";
     }
     // line 8
     echo "\n      ";
     // line 10
     echo "      <a href=\"";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "a", array())) {
         echo $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "a", array());
     } else {
         echo "#";
     }
     echo "\" ";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "a", array())) {
     } else {
         echo "onclick=\"play('shot-a')\"";
     }
     echo ">\n        <div id=\"soldier_a\"></div>\n      </a>\n      <audio id=\"shot-a\" src=\"";
     // line 13
     echo $this->env->getExtension('GravTwigExtension')->urlFunc("theme://static/audio/shot-a.mp3");
     echo "\" ></audio>\n\n      ";
     // line 16
     echo "      <a href=\"";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "b", array())) {
         echo $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "b", array());
     } else {
         echo "#";
     }
     echo "\" ";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "b", array())) {
     } else {
         echo "onclick=\"play('shot-b')\"";
     }
     echo ">\n        <div id=\"soldier_b\"></div>\n      </a>\n      <audio id=\"shot-b\" src=\"";
     // line 19
     echo $this->env->getExtension('GravTwigExtension')->urlFunc("theme://static/audio/shot-b.mp3");
     echo "\" ></audio>\n\n      ";
     // line 22
     echo "      <a href=\"";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "c", array())) {
         echo $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "c", array());
     } else {
         echo "#";
     }
     echo "\" ";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "c", array())) {
     } else {
         echo "onclick=\"play('shot-c')\"";
     }
     echo ">\n        <div id=\"soldier_c\"></div>\n      </a>\n      <audio id=\"shot-c\" src=\"";
     // line 25
     echo $this->env->getExtension('GravTwigExtension')->urlFunc("theme://static/audio/shot-c.mp3");
     echo "\" ></audio>\n\n      ";
     // line 28
     echo "      <a href=\"";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "d", array())) {
         echo $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "d", array());
     } else {
         echo "#";
     }
     echo "\" ";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "d", array())) {
     } else {
         echo "onclick=\"play('shot-d')\"";
     }
     echo ">\n        <div id=\"soldier_d\"></div>\n      </a>\n      <audio id=\"shot-d\" src=\"";
     // line 31
     echo $this->env->getExtension('GravTwigExtension')->urlFunc("theme://static/audio/shot-d.mp3");
     echo "\" ></audio>\n\n      ";
     // line 34
     echo "      <a href=\"";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "e", array())) {
         echo $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "e", array());
     } else {
         echo "#";
     }
     echo "\" ";
     if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "e", array())) {
     } else {
         echo "onclick=\"play('shot-5')\"";
     }
     echo ">\n        <div id=\"soldier_e\"></div>\n      </a>\n      <audio id=\"shot-5\" src=\"";
     // line 37
     echo $this->env->getExtension('GravTwigExtension')->urlFunc("theme://static/audio/shot-e.mp3");
     echo "\" ></audio>\n\n      ";
     // line 40
     echo "      <a href=\"";
//.........这里部分代码省略.........
开发者ID:alexslack,项目名称:faith-game,代码行数:101,代码来源:c0f722343ae28519bb30f8ef3de68957c41dbdeadd063c5a6834cca7d4ddb3da.php


示例7: getform_tree_details

 public function getform_tree_details($_name = null, $_data = null, $_forms_by_hash = null)
 {
     $context = $this->env->mergeGlobals(array("name" => $_name, "data" => $_data, "forms_by_hash" => $_forms_by_hash));
     $blocks = array();
     ob_start();
     try {
         // line 440
         echo "    <div class=\"tree-details\" id=\"";
         echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "data"), "id"), "html", null, true);
         echo "-details\">\n        <h2>\n            ";
         // line 442
         echo twig_escape_filter($this->env, $this->getContext($context, "name"), "html", null, true);
         echo "\n            ";
         // line 443
         if ($this->getAttribute($this->getContext($context, "data", true), "type_class", array(), "any", true, true)) {
             // line 444
             echo "            <span class=\"form-type\">[<abbr title=\"";
             echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "data"), "type_class"), "html", null, true);
             echo "\">";
             echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "data"), "type"), "html", null, true);
             echo "</abbr>]</span>\n            ";
         }
         // line 446
         echo "        </h2>\n\n        ";
         // line 448
         if ($this->getAttribute($this->getContext($context, "data", true), "errors", array(), "any", true, true) && twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "data"), "errors")) > 0) {
             // line 449
             echo "        <div class=\"errors\">\n            <h3>\n                <a class=\"toggle-button\" data-toggle-target-id=\"";
             // line 451
             echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "data"), "id"), "html", null, true);
             echo "-errors\" href=\"#\">\n                    Errors\n                    <span class=\"toggle-icon\"></span>\n                </a>\n            </h3>\n\n            <table id=\"";
             // line 457
             echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "data"), "id"), "html", null, true);
             echo "-errors\">\n                <tr>\n                    <th>Message</th>\n                    <th>Origin</th>\n                    <th>Cause</th>\n                </tr>\n                ";
             // line 463
             $context['_parent'] = (array) $context;
             $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "data"), "errors"));
             foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
                 // line 464
                 echo "                <tr>\n                    <td>";
                 // line 465
                 echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "error"), "message"), "html", null, true);
                 echo "</td>\n                    <td>\n                        ";
                 // line 467
                 if (twig_test_empty($this->getAttribute($this->getContext($context, "error"), "origin"))) {
                     // line 468
                     echo "                            <em>This form.</em>\n                        ";
                 } elseif (!$this->getAttribute($this->getContext($context, "forms_by_hash", true), $this->getAttribute($this->getContext($context, "error"), "origin"), array(), "array", true, true)) {
                     // line 470
                     echo "                            <em>Unknown.</em>\n                        ";
                 } else {
                     // line 472
                     echo "                            ";
                     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "forms_by_hash"), $this->getAttribute($this->getContext($context, "error"), "origin"), array(), "array"), "name"), "html", null, true);
                     echo "\n                        ";
                 }
                 // line 474
                 echo "                    </td>\n                    <td>\n                        ";
                 // line 476
                 if (twig_test_empty($this->getAttribute($this->getContext($context, "error"), "cause"))) {
                     // line 477
                     echo "                            <em>Unknown.</em>\n                        ";
                 } elseif ($this->getAttribute($this->getAttribute($this->getContext($context, "error", true), "cause", array(), "any", false, true), "root", array(), "any", true, true)) {
                     // line 479
                     echo "                            <strong>Constraint Violation</strong><br/>\n                            <pre>";
                     // line 480
                     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "error"), "cause"), "root"), "html", null, true);
                     if (!twig_test_empty($this->getAttribute($this->getAttribute($this->getContext($context, "error"), "cause"), "path"))) {
                         if (twig_first($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "error"), "cause"), "path")) != "[") {
                             echo ".";
                         }
                         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "error"), "cause"), "path"), "html", null, true);
                     }
                     echo " = ";
                     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "error"), "cause"), "value"), "html", null, true);
                     echo "</pre>\n                        ";
                 } else {
                     // line 482
                     echo "                            <pre>";
                     echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "error"), "cause"), "html", null, true);
                     echo "</pre>\n                        ";
                 }
                 // line 484
                 echo "                    </td>\n                </tr>\n                ";
             }
             $_parent = $context['_parent'];
             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['error'], $context['_parent'], $context['loop']);
             $context = array_intersect_key($context, $_parent) + $_parent;
             // line 487
             echo "            </table>\n        </div>\n        ";
         }
         // line 490
         echo "\n        ";
         // line 491
         if ($this->getAttribute($this->getContext($context, "data", true), "default_data", array(), "any", true, true)) {
             // line 492
             echo "        <h3>\n            <a class=\"toggle-button\" data-toggle-target-id=\"";
             // line 493
             echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "data"), "id"), "html", null, true);
             echo "-default_data\" href=\"#\">\n                Default Data\n                <span class=\"toggle-icon\"></span>\n            </a>\n        </h3>\n\n        <div id=\"";
//.........这里部分代码省略.........
开发者ID:miteshchavada,项目名称:svipl,代码行数:101,代码来源:5219d9119787db0b2e78ac686f4b9009cc388d86aa29736188740912e341.php


示例8: getrender_table

 public function getrender_table($__logs__ = null, $__show_level__ = false, $__is_deprecation__ = false)
 {
     $context = $this->env->mergeGlobals(array("logs" => $__logs__, "show_level" => $__show_level__, "is_deprecation" => $__is_deprecation__, "varargs" => func_num_args() > 3 ? array_slice(func_get_args(), 3) : array()));
     $blocks = array();
     ob_start();
     try {
         $__internal_894934c57482609cd2f4e9e64f1ea0d6e42ccb3d32879f9ecb5682127a1bdd9c = $this->env->getExtension("native_profiler");
         $__internal_894934c57482609cd2f4e9e64f1ea0d6e42ccb3d32879f9ecb5682127a1bdd9c->enter($__internal_894934c57482609cd2f4e9e64f1ea0d6e42ccb3d32879f9ecb5682127a1bdd9c_prof = new Twig_Profiler_Profile($this->getTemplateName(), "macro", "render_table"));
         // line 133
         echo "    ";
         $context["helper"] = $this;
         // line 134
         echo "    ";
         $context["channel_is_defined"] = $this->getAttribute(twig_first($this->env, isset($context["logs"]) ? $context["logs"] : $this->getContext($context, "logs")), "channel", array(), "any", true, true);
         // line 135
         echo "\n    <table class=\"logs\">\n        <thead>\n            <tr>\n                <th>";
         // line 139
         echo isset($context["show_level"]) ? $context["show_level"] : $this->getContext($context, "show_level") ? "Level" : "Time";
         echo "</th>\n                ";
         // line 140
         if (isset($context["channel_is_defined"]) ? $context["channel_is_defined"] : $this->getContext($context, "channel_is_defined")) {
             echo "<th>Channel</th>";
         }
         // line 141
         echo "                <th>Message</th>\n            </tr>\n        </thead>\n\n        <tbody>\n            ";
         // line 146
         $context['_parent'] = $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["logs"]) ? $context["logs"] : $this->getContext($context, "logs"));
         $context['loop'] = array('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["log"]) {
             // line 147
             echo "                ";
             $context["css_class"] = isset($context["is_deprecation"]) ? $context["is_deprecation"] : $this->getContext($context, "is_deprecation") ? "" : (twig_in_filter($this->getAttribute($context["log"], "priorityName", array()), array(0 => "CRITICAL", 1 => "ERROR", 2 => "ALERT", 3 => "EMERGENCY")) ? "status-error" : (twig_in_filter($this->getAttribute($context["log"], "priorityName", array()), array(0 => "NOTICE", 1 => "WARNING")) ? "status-warning" : ""));
             // line 151
             echo "                <tr class=\"";
             echo twig_escape_filter($this->env, isset($context["css_class"]) ? $context["css_class"] : $this->getContext($context, "css_class"), "html", null, true);
             echo "\">\n                    <td class=\"font-normal text-small\">\n                        ";
             // line 153
             if (isset($context["show_level"]) ? $context["show_level"] : $this->getContext($context, "show_level")) {
                 // line 154
                 echo "                            <span class=\"colored text-bold nowrap\">";
                 echo twig_escape_filter($this->env, $this->getAttribute($context["log"], "priorityName", array()), "html", null, true);
                 echo "</span>\n                        ";
             }
             // line 156
             echo "                        <span class=\"text-muted nowrap newline\">";
             echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute($context["log"], "timestamp", array()), "H:i:s"), "html", null, true);
             echo "</span>\n                    </td>\n\n                    ";
             // line 159
             if (isset($context["channel_is_defined"]) ? $context["channel_is_defined"] : $this->getContext($context, "channel_is_defined")) {
                 // line 160
                 echo "                        <td class=\"font-normal text-small text-bold nowrap\">";
                 echo twig_escape_filter($this->env, $this->getAttribute($context["log"], "channel", array()), "html", null, true);
                 echo "</td>\n                    ";
             }
             // line 162
             echo "\n                    <td class=\"font-normal\">";
             // line 163
             echo $context["helper"]->getrender_log_message($this->getAttribute($context["loop"], "index", array()), $context["log"], isset($context["is_deprecation"]) ? $context["is_deprecation"] : $this->getContext($context, "is_deprecation"));
             echo "</td>\n                </tr>\n            ";
             ++$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['log'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 166
         echo "        </tbody>\n    </table>\n";
         $__internal_894934c57482609cd2f4e9e64f1ea0d6e42ccb3d32879f9ecb5682127a1bdd9c->leave($__internal_894934c57482609cd2f4e9e64f1ea0d6e42ccb3d32879f9ecb5682127a1bdd9c_prof);
     } catch (Exception $e) {
         ob_end_clean();
         throw $e;
     }
     return '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
 }
开发者ID:karolskora1993,项目名称:strona-przedszkola,代码行数:88,代码来源:98646ee86dd19a8324b3a6c911f8983991eaf258960e6766fcd57b79dd9ed162.php


示例9: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $__internal_091399f3bbd64d2b3cad8091de389c4fbb06bc591d3e67eb9ae2ac076ddcb9e8 = $this->env->getExtension("native_profiler");
     $__internal_091399f3bbd64d2b3cad8091de389c4fbb06bc591d3e67eb9ae2ac076ddcb9e8->enter($__internal_091399f3bbd64d2b3cad8091de389c4fbb06bc591d3e67eb9ae2ac076ddcb9e8_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "DoctrineBundle:Collector:explain.html.twig"));
     // line 1
     if (twig_length_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), 0, array(), "array")) > 1) {
         // line 2
         echo "    ";
         // line 3
         echo "    <table style=\"margin: 5px 0;\">\n        <thead>\n            <tr>\n                ";
         // line 6
         $context['_parent'] = $context;
         $context['_seq'] = twig_ensure_traversable(twig_get_array_keys_filter($this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), 0, array(), "array")));
         foreach ($context['_seq'] as $context["_key"] => $context["label"]) {
             // line 7
             echo "                    <th>";
             echo twig_escape_filter($this->env, $context["label"], "html", null, true);
             echo "</th>\n                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['label'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 9
         echo "            </tr>\n        </thead>\n        <tbody>\n            ";
         // line 12
         $context['_parent'] = $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"));
         foreach ($context['_seq'] as $context["_key"] => $context["row"]) {
             // line 13
             echo "            <tr>\n                ";
             // line 14
             $context['_parent'] = $context;
             $context['_seq'] = twig_ensure_traversable($context["row"]);
             foreach ($context['_seq'] as $context["key"] => $context["item"]) {
                 // line 15
                 echo "                    <td>";
                 echo twig_escape_filter($this->env, twig_replace_filter($context["item"], array("," => ", ")), "html", null, true);
                 echo "</td>\n                ";
             }
             $_parent = $context['_parent'];
             unset($context['_seq'], $context['_iterated'], $context['key'], $context['item'], $context['_parent'], $context['loop']);
             $context = array_intersect_key($context, $_parent) + $_parent;
             // line 17
             echo "            </tr>\n            ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['row'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 19
         echo "        </tbody>\n    </table>\n";
     } else {
         // line 22
         echo "    ";
         // line 23
         echo "    <pre style=\"margin: 5px 0;\">";
         // line 24
         $context['_parent'] = $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"));
         foreach ($context['_seq'] as $context["_key"] => $context["row"]) {
             // line 25
             echo twig_escape_filter($this->env, twig_first($this->env, $context["row"]), "html", null, true);
             echo "\n";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['row'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 27
         echo "</pre>\n";
     }
     $__internal_091399f3bbd64d2b3cad8091de389c4fbb06bc591d3e67eb9ae2ac076ddcb9e8->leave($__internal_091399f3bbd64d2b3cad8091de389c4fbb06bc591d3e67eb9ae 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP twig_get_array_keys_filter函数代码示例发布时间:2022-05-23
下一篇:
PHP twig_escape_filter函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap