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

PHP twig_escape_filter函数代码示例

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

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



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

示例1: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f = $this->env->getExtension("native_profiler");
     $__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f->enter($__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "WebProfilerBundle:Profiler:toolbar_item.html.twig"));
     // line 1
     if (isset($context["link"]) ? $context["link"] : $this->getContext($context, "link")) {
         // line 2
         echo "    ";
         ob_start();
         // line 3
         echo "        <a href=\"";
         echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => isset($context["token"]) ? $context["token"] : $this->getContext($context, "token"), "panel" => isset($context["name"]) ? $context["name"] : $this->getContext($context, "name"))), "html", null, true);
         echo "\">";
         echo twig_escape_filter($this->env, isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "html", null, true);
         echo "</a>\n    ";
         $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
     }
     // line 6
     echo "<div class=\"sf-toolbar-block\">\n     <div class=\"sf-toolbar-icon\">";
     // line 7
     echo twig_escape_filter($this->env, array_key_exists("icon", $context) ? _twig_default_filter(isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "") : "", "html", null, true);
     echo "</div>\n     <div class=\"sf-toolbar-info\">";
     // line 8
     echo twig_escape_filter($this->env, array_key_exists("text", $context) ? _twig_default_filter(isset($context["text"]) ? $context["text"] : $this->getContext($context, "text"), "") : "", "html", null, true);
     echo "</div>\n</div>\n";
     $__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f->leave($__internal_7088dc18de042b162a99a327c85232e1f7c79938f5c6e62a2f20a47464d52c5f_prof);
 }
开发者ID:valeriemontoya90,项目名称:findWorker,代码行数:27,代码来源:8d4635b47ab8ab3bf3352cb81a02e822f23088a5da0711f03c5ad81c103fe122.php


示例2: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<form action=\"";
     echo $this->env->getExtension('routing')->getPath("fos_user_security_check");
     echo "\" method=\"post\">\n    <fieldset>\n    <input type=\"hidden\" name=\"_csrf_token\" value=\"";
     // line 3
     echo twig_escape_filter($this->env, isset($context["csrf_token"]) ? $context["csrf_token"] : null, "html", null, true);
     echo "\" />\n\n    <label for=\"username\">";
     // line 5
     echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.username", array(), "FOSUserBundle"), "html", null, true);
     echo "</label>\n    <input type=\"text\" id=\"username\" name=\"_username\" value=\"";
     // line 6
     echo twig_escape_filter($this->env, isset($context["last_username"]) ? $context["last_username"] : null, "html", null, true);
     echo "\" />\n\n        <p> <label for=\"password\">";
     // line 8
     echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.password", array(), "FOSUserBundle"), "html", null, true);
     echo "</label>\n    <input type=\"password\" id=\"password\" name=\"_password\" /></p>\n\n        <p><input type=\"checkbox\" id=\"remember_me\" name=\"_remember_me\" value=\"on\" />\n    <label for=\"remember_me\">";
     // line 12
     echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.remember_me", array(), "FOSUserBundle"), "html", null, true);
     echo "</label></p>\n\n        <p><input type=\"submit\" id=\"_submit\" name=\"_submit\" value=\"";
     // line 14
     echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("security.login.submit", array(), "FOSUserBundle"), "html", null, true);
     echo "\" /></p>\n    </fieldset>\n</form>";
 }
开发者ID:AetFrance,项目名称:SiteFoyerAet,代码行数:25,代码来源:63b4a2a74b07ca01c40a89cb7660d94996a3c05d473adfc3df018ce326e0.php


示例3: block_toolbar

 public function block_toolbar($context, array $blocks = array())
 {
     // line 4
     echo "    ";
     ob_start();
     // line 5
     echo "        <span>\n            <img width=\"13\" height=\"28\" alt=\"Memory Usage\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAcBAMAAABITyhxAAAAJ1BMVEXNzc3///////////////////////8/Pz////////////+NjY0/Pz9lMO+OAAAADHRSTlMAABAgMDhAWXCvv9e8JUuyAAAAQ0lEQVQI12MQBAMBBmLpMwoMDAw6BxjOOABpHyCdAKRzsNDp5eXl1KBh5oHBAYY9YHoDQ+cqIFjZwGCaBgSpBrjcCwCZgkUHKKvX+wAAAABJRU5ErkJggg==\" />\n            <span>";
     // line 7
     echo twig_escape_filter($this->env, sprintf("%.1f", $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memory") / 1024 / 1024), "html", null, true);
     echo " MB</span>\n        </span>\n    ";
     $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
     // line 10
     echo "    ";
     ob_start();
     // line 11
     echo "        <div class=\"sf-toolbar-info-piece\">\n            <b>Memory usage</b>\n            <span>";
     // line 13
     echo twig_escape_filter($this->env, sprintf("%.1f", $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memory") / 1024 / 1024), "html", null, true);
     echo " / ";
     echo $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memoryLimit") == -1 ? "&infin;" : twig_escape_filter($this->env, sprintf("%.1f", $this->getAttribute(isset($context["collector"]) ? $context["collector"] : $this->getContext($context, "collector"), "memoryLimit") / 1024 / 1024));
     echo " MB</span>\n        </div>\n    ";
     $context["text"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
     // line 16
     echo "    ";
     $this->env->loadTemplate("@WebProfiler/Profiler/toolbar_item.html.twig")->display(array_merge($context, array("link" => false)));
 }
开发者ID:NickPolyder,项目名称:WebVillas-Symfony2Edition-,代码行数:26,代码来源:ffe26a9a069fb38f1ae6a5b4c3d95b460995085423a62ae5d80b53fbea61.php


示例4: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<ol class=\"traces logs\">\n    ";
     // line 2
     $context['_parent'] = $context;
     $context['_seq'] = twig_ensure_traversable(isset($context["logs"]) ? $context["logs"] : null);
     foreach ($context['_seq'] as $context["_key"] => $context["log"]) {
         // line 3
         echo "        <li";
         if ($this->getAttribute($context["log"], "priority", array()) >= 400) {
             echo " class=\"error\"";
         } elseif ($this->getAttribute($context["log"], "priority", array()) >= 300) {
             echo " class=\"warning\"";
         }
         echo ">\n            ";
         // line 4
         echo twig_escape_filter($this->env, $this->getAttribute($context["log"], "priorityName", array()), "html", null, true);
         echo " - ";
         echo twig_escape_filter($this->env, $this->getAttribute($context["log"], "message", array()), "html", null, true);
         echo "\n        </li>\n    ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['log'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 7
     echo "</ol>\n";
 }
开发者ID:LamaDelRay,项目名称:test_symf,代码行数:28,代码来源:8811a782108950f5bfd2a427029df82e2acf535e06249c53ca5553b4b746f753.php


示例5: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70 = $this->env->getExtension("native_profiler");
     $__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70->enter($__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "@WebProfiler/Profiler/toolbar_item.html.twig"));
     // line 1
     if (isset($context["link"]) ? $context["link"] : $this->getContext($context, "link")) {
         // line 2
         echo "    ";
         ob_start();
         // line 3
         echo "        <a href=\"";
         echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => isset($context["token"]) ? $context["token"] : $this->getContext($context, "token"), "panel" => isset($context["name"]) ? $context["name"] : $this->getContext($context, "name"))), "html", null, true);
         echo "\">";
         echo twig_escape_filter($this->env, isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "html", null, true);
         echo "</a>\n    ";
         $context["icon"] = '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
     }
     // line 6
     echo "<div class=\"sf-toolbar-block\">\n     <div class=\"sf-toolbar-icon\">";
     // line 7
     echo twig_escape_filter($this->env, array_key_exists("icon", $context) ? _twig_default_filter(isset($context["icon"]) ? $context["icon"] : $this->getContext($context, "icon"), "") : "", "html", null, true);
     echo "</div>\n     <div class=\"sf-toolbar-info\">";
     // line 8
     echo twig_escape_filter($this->env, array_key_exists("text", $context) ? _twig_default_filter(isset($context["text"]) ? $context["text"] : $this->getContext($context, "text"), "") : "", "html", null, true);
     echo "</div>\n</div>\n";
     $__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70->leave($__internal_f6fbb0d538f0cf945a7cc2537fcd6ea50556067234df0d59685d58ab6cd80c70_prof);
 }
开发者ID:NotBadCode,项目名称:FinanceTest,代码行数:27,代码来源:02d42ef81b938fabb9028e93c7663e4c7dcdca2fdae35e978661f8a8aa0ccd29.php


示例6: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<table ";
     if (array_key_exists("class", $context)) {
         echo "class='";
         echo twig_escape_filter($this->env, isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "html", null, true);
         echo "'";
     }
     echo " >\n    <thead>\n        <tr>\n            <th scope=\"col\">Key</th>\n            <th scope=\"col\">Value</th>\n        </tr>\n    </thead>\n    <tbody>\n        ";
     // line 9
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable(twig_sort_filter($this->getAttribute(isset($context["bag"]) ? $context["bag"] : $this->getContext($context, "bag"), "keys", array())));
     foreach ($context['_seq'] as $context["_key"] => $context["key"]) {
         // line 10
         echo "            <tr>\n                <th>";
         // line 11
         echo twig_escape_filter($this->env, $context["key"], "html", null, true);
         echo "</th>\n                ";
         // line 13
         echo "                <td>";
         echo twig_escape_filter($this->env, twig_jsonencode_filter($this->getAttribute(isset($context["bag"]) ? $context["bag"] : $this->getContext($context, "bag"), "get", array(0 => $context["key"]), "method"), 64 | 256), "html", null, true);
         echo "</td>\n            </tr>\n        ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['key'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 16
     echo "    </tbody>\n</table>\n";
 }
开发者ID:jeremie38,项目名称:tpphp,代码行数:30,代码来源:294e791c5ea4d93f9eb84ce94046b071c2ef58397c3bdaa14b5a0b85a62e00d7.php


示例7: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<!DOCTYPE html>\n<html lang=\"es\">\n  <head>\n    <meta charset=\"utf-8\">\n\n    <title>Starter Template for Bootstrap</title>\n    <link href=\"";
     // line 7
     echo twig_escape_filter($this->env, $this->env->getExtension('asset')->getAssetUrl("bundles/demodb/css/bootstrap.min.css"), "html", null, true);
     echo "\" rel=\"stylesheet\">\n    <link href=\"";
     // line 8
     echo twig_escape_filter($this->env, $this->env->getExtension('asset')->getAssetUrl("bundles/demodb/css/starter.css"), "html", null, true);
     echo "\" rel=\"stylesheet\">\n\n  </head>\n\n  <body>\n\n    <nav class=\"navbar navbar-inverse navbar-fixed-top\">\n      <div class=\"container\">\n        <div class=\"navbar-header\">\n          <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#navbar\" aria-expanded=\"false\" aria-controls=\"navbar\">\n            <span class=\"sr-only\">Toggle navigation</span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n            <span class=\"icon-bar\"></span>\n          </button>\n          <a class=\"navbar-brand\" href=\"#\">Demo</a>\n        </div>\n        <div id=\"navbar\" class=\"collapse navbar-collapse\">\n          <ul class=\"nav navbar-nav\">\n            <li class=\"active\"><a href=\"";
     // line 27
     echo $this->env->getExtension('routing')->getPath("fos_user_security_login");
     echo "\">Iniciar Session</a></li>\n            <li><a href=\"";
     // line 28
     echo $this->env->getExtension('routing')->getPath("fos_user_registration_register");
     echo "\">Nuevo Usuario</a></li>\n            <li><a href=\"";
     // line 29
     echo $this->env->getExtension('routing')->getPath("fos_user_resetting_request");
     echo "\">Reset de Password</a></li>\n          </ul>\n        </div><!--/.nav-collapse -->\n      </div>\n    </nav>\n\n    <div class=\"container\">\n      <div class=\"starter-template\">\n      <br><br>\n        <h1>Bootstrap starter template</h1>\n        <p class=\"lead\">Use this document as a way to quickly start any new project.<br> All you get is this text and a mostly barebones HTML document.</p>\n      </div>\n\n    </div><!-- /.container -->\n\n\n    <!-- Bootstrap core JavaScript\n    ================================================== -->\n    <!-- Placed at the end of the document so the pages load faster -->\n    <script src=\"";
     // line 48
     echo twig_escape_filter($this->env, $this->env->getExtension('asset')->getAssetUrl("bundles/demodb/js/jquery.js"), "html", null, true);
     echo "\"></script>\n    <script>window.jQuery || document.write('<script src=\"../../assets/js/vendor/jquery.min.js\"><\\/script>')</script>\n    <script src=\"";
     // line 50
     echo twig_escape_filter($this->env, $this->env->getExtension('asset')->getAssetUrl("bundles/demodb/js/bootstrap.min.js"), "html", null, true);
     echo "\"></script>\n\n  </body>\n</html>\n";
 }
开发者ID:tsurune,项目名称:Pruebas,代码行数:26,代码来源:5949b84dcb1d1526a5fca05cd56d1610afe156ad97b58b4379fdd34a686c10b5.php


示例8: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<!-- Map -->\n<div id=\"map-canvas\" class=\"google-map\" style=\"height: ";
     // line 2
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "height"), "method"), "html", null, true);
     echo "; width: ";
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "width"), "method"), "html", null, true);
     echo ";\"></div>\n<script src=\"https://maps.googleapis.com/maps/api/js?v=3.exp&key=";
     // line 3
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "apiKey"), "method"), "html", null, true);
     echo "\"></script> \n<script>\n// This example adds a marker to indicate the position\n// of Bondi Beach in Sydney, Australia\nfunction initialize() {\n    var center = new google.maps.LatLng(";
     // line 8
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "latitude"), "method"), "html", null, true);
     echo ", ";
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "longitude"), "method"), "html", null, true);
     echo ");\n\n    var mapOptions = {\n      zoom: ";
     // line 11
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "zoom"), "method"), "html", null, true);
     echo ",\n      center: center,\n      scrollwheel: false,\n      navigationControl: false,\n      mapTypeControl: false,\n      scaleControl: false,\n      draggable: true,\n      zoomControl:false,\n      streetViewControl:false,\n      overviewMapControl:false,\n      rotateControl:false,\n      mapTypeId: google.maps.MapTypeId.";
     // line 22
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "mapTypeId"), "method"), "html", null, true);
     echo "\n    }\n\n    var map = new google.maps.Map(document.getElementById('map-canvas'),mapOptions);\n    var styles = [\n\t{\n\t\tstylers: [\n\t\t\t{ saturation: -100 },\n\t                { \"invert_lightness\": false },\n\t                { lightness: 30 }\n\t        ]\n\t}\n];\n    map.setOptions({styles: styles});\n\n    ";
     // line 37
     if ($this->getAttribute(isset($context["__SELF__"]) ? $context["__SELF__"] : null, "property", array(0 => "showMarker"), "method")) {
         // line 38
         echo "        var beachMarker = new google.maps.Marker({\n        map: map,\n        icon: {\n            path: fontawesome.markers.MAP_MARKER,\n            scale: 0.8,\n            strokeWeight: 0.2,\n            strokeColor: 'white',\n            strokeOpacity: 1,\n            fillColor: '#ff7043',\n            fillOpacity: 1,\n        },\n        clickable: false,\n        position: center\n    });\n    ";
     }
     // line 53
     echo "}\n\ngoogle.maps.event.addDomListener(window, 'load', initialize);\n</script>";
 }
开发者ID:tysonrude,项目名称:bloom7,代码行数:31,代码来源:bfdd3c9453a2872dfdb7c7016ed4afe325931fbd8f77d6cff6f17e0cfbda18e2.php


示例9: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     $__internal_b3a06b7d0e322b7e3a01f7ab3182288c77c6940258883e2ae9f5f2edc60fec34 = $this->env->getExtension("native_profiler");
     $__internal_b3a06b7d0e322b7e3a01f7ab3182288c77c6940258883e2ae9f5f2edc60fec34->enter($__internal_b3a06b7d0e322b7e3a01f7ab3182288c77c6940258883e2ae9f5f2edc60fec34_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "WebProfilerBundle:Profiler:base_js.html.twig"));
     // line 1
     echo "<script>/*<![CDATA[*/\n    ";
     // line 5
     echo "\n    Sfjs = (function() {\n        \"use strict\";\n\n        var classListIsSupported = 'classList' in document.documentElement;\n\n        if (classListIsSupported) {\n            var hasClass = function (el, cssClass) { return el.classList.contains(cssClass); };\n            var removeClass = function(el, cssClass) { el.classList.remove(cssClass); };\n            var addClass = function(el, cssClass) { el.classList.add(cssClass); };\n            var toggleClass = function(el, cssClass) { el.classList.toggle(cssClass); };\n        } else {\n            var hasClass = function (el, cssClass) { return el.className.match(new RegExp('\\\\b' + cssClass + '\\\\b')); };\n            var removeClass = function(el, cssClass) { el.className = el.className.replace(new RegExp('\\\\b' + cssClass + '\\\\b'), ' '); };\n            var addClass = function(el, cssClass) { if (!hasClass(el, cssClass)) { el.className += \" \" + cssClass; } };\n            var toggleClass = function(el, cssClass) { hasClass(el, cssClass) ? removeClass(el, cssClass) : addClass(el, cssClass); };\n        }\n\n        var noop = function() {},\n\n            collectionToArray = function (collection) {\n                var length = collection.length || 0,\n                    results = new Array(length);\n\n                while (length--) {\n                    results[length] = collection[length];\n                }\n\n                return results;\n            },\n\n            profilerStorageKey = 'sf2/profiler/',\n\n            request = function(url, onSuccess, onError, payload, options) {\n                var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP');\n                options = options || {};\n                options.maxTries = options.maxTries || 0;\n                xhr.open(options.method || 'GET', url, true);\n                xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n                xhr.onreadystatechange = function(state) {\n                    if (4 !== xhr.readyState) {\n                        return null;\n                    }\n\n                    if (xhr.status == 404 && options.maxTries > 1) {\n                        setTimeout(function(){\n                            options.maxTries--;\n                            request(url, onSuccess, onError, payload, options);\n                        }, 500);\n\n                        return null;\n                    }\n\n                    if (200 === xhr.status) {\n                        (onSuccess || noop)(xhr);\n                    } else {\n                        (onError || noop)(xhr);\n                    }\n                };\n                xhr.send(payload || '');\n            },\n\n            getPreference = function(name) {\n                if (!window.localStorage) {\n                    return null;\n                }\n\n                return localStorage.getItem(profilerStorageKey + name);\n            },\n\n            setPreference = function(name, value) {\n                if (!window.localStorage) {\n                    return null;\n                }\n\n                localStorage.setItem(profilerStorageKey + name, value);\n            },\n\n            requestStack = [],\n\n            renderAjaxRequests = function() {\n                var requestCounter = document.querySelectorAll('.sf-toolbar-ajax-requests');\n                if (!requestCounter.length) {\n                    return;\n                }\n\n                var ajaxToolbarPanel = document.querySelector('.sf-toolbar-block-ajax');\n                var tbodies = document.querySelectorAll('.sf-toolbar-ajax-request-list');\n                var state = 'ok';\n                if (tbodies.length) {\n                    var tbody = tbodies[0];\n\n                    var rows = document.createDocumentFragment();\n\n                    if (requestStack.length) {\n                        for (var i = 0; i < requestStack.length; i++) {\n                            var request = requestStack[i];\n\n                            var row = document.createElement('tr');\n                            rows.appendChild(row);\n\n                            var methodCell = document.createElement('td');\n                            if (request.error) {\n                                methodCell.className = 'sf-ajax-request-error';\n                            }\n                            methodCell.textContent = request.method;\n                            row.appendChild(methodCell);\n\n                            var pathCell = document.createElement('td');\n                            pathCell.className = 'sf-ajax-request-url';\n                            if ('GET' === request.method) {\n                                var pathLink = document.createElement('a');\n                                pathLink.setAttribute('href', request.url);\n                                pathLink.textContent = request.url;\n                                pathCell.appendChild(pathLink);\n                            } else {\n                                pathCell.textContent = request.url;\n                            }\n                            pathCell.setAttribute('title', request.url);\n                            row.appendChild(pathCell);\n\n                            var durationCell = document.createElement('td');\n                            durationCell.className = 'sf-ajax-request-duration';\n\n                            if (request.duration) {\n                                durationCell.textContent = request.duration + \"ms\";\n                            } else {\n                                durationCell.textContent = '-';\n                            }\n                            row.appendChild(durationCell);\n\n                            row.appendChild(document.createTextNode(' '));\n                            var profilerCell = document.createElement('td');\n\n                            if (request.profilerUrl) {\n                                var profilerLink = document.createElement('a');\n                                profilerLink.setAttribute('href', request.profilerUrl);\n                                profilerLink.textContent = request.profile;\n                                profilerCell.appendChild(profilerLink);\n                            } else {\n                                profilerCell.textContent = 'n/a';\n                            }\n\n                            row.appendChild(profilerCell);\n\n                            var requestState = 'ok';\n                            if (request.error) {\n                                requestState = 'error';\n                                if (state != \"loading\" && i > requestStack.length - 4) {\n                                    state = 'error';\n                                }\n                            } else if (request.loading) {\n                                requestState = 'loading';\n                                state = 'loading';\n                            }\n                            row.className = 'sf-ajax-request sf-ajax-request-' + requestState;\n                        }\n\n                        var infoSpan = document.querySelectorAll(\".sf-toolbar-ajax-info\")[0];\n                        var children = collectionToArray(tbody.children);\n                        for (var i = 0; i < children.length; i++) {\n                            tbody.removeChild(children[i]);\n                        }\n                        tbody.appendChild(rows);\n\n                        if (infoSpan) {\n                            var text = requestStack.length + ' AJAX request' + (requestStack.length > 1 ? 's' : '');\n                            infoSpan.textContent = text;\n                        }\n\n                        ajaxToolbarPanel.style.display = 'block';\n                    } else {\n                        ajaxToolbarPanel.style.display = 'none';\n                    }\n                }\n\n                requestCounter[0].textContent = requestStack.length;\n\n                var className = 'sf-toolbar-ajax-requests sf-toolbar-value';\n                requestCounter[0].className = className;\n\n                if (state == 'ok') {\n                    Sfjs.removeClass(ajaxToolbarPanel, 'sf-ajax-request-loading');\n                    Sfjs.removeClass(ajaxToolbarPanel, 'sf-toolbar-status-red');\n                } else if (state == 'error') {\n                    Sfjs.addClass(ajaxToolbarPanel, 'sf-toolbar-status-red');\n                } else {\n                    Sfjs.addClass(ajaxToolbarPanel, 'sf-ajax-request-loading');\n                }\n            };\n\n        var addEventListener;\n\n        var el = document.createElement('div');\n        if (!'addEventListener' in el) {\n            addEventListener = function (element, eventName, callback) {\n                element.attachEvent('on' + eventName, callback);\n            };\n        } else {\n            addEventListener = function (element, eventName, callback) {\n                element.addEventListener(eventName, callback, false);\n            };\n        }\n\n        ";
     // line 209
     if (array_key_exists("excluded_ajax_paths", $context)) {
         // line 210
         echo "            if (window.XMLHttpRequest && XMLHttpRequest.prototype.addEventListener) {\n                var proxied = XMLHttpRequest.prototype.open;\n\n                XMLHttpRequest.prototype.open = function(method, url, async, user, pass) {\n                    var self = this;\n\n                    /* prevent logging AJAX calls to static and inline files, like templates */\n                    var path = url;\n                    if (url.substr(0, 1) === '/') {\n                        if (0 === url.indexOf('";
         // line 219
         echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : $this->getContext($context, "request"), "basePath", array()), "js"), "html", null, true);
         echo "')) {\n                            path = url.substr(";
         // line 220
         echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : $this->getContext($context, "request"), "basePath", array())), "html", null, true);
         echo ");\n                        }\n                    }\n                    else if (0 === url.indexOf('";
         // line 223
         echo twig_escape_filter($this->env, twig_escape_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : $this->getContext($context, "request"), "schemeAndHttpHost", array()) . $this->getAttribute(isset($context["request"]) ? $context["request"] : $this->getContext($context, "request"), "basePath", array()), "js"), "html", null, true);
         echo "')) {\n                        path = url.substr(";
         // line 224
         echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute(isset($context["request"]) ? $context["request"] : $this->getContext($context, "request"), "schemeAndHttpHost", array()) . $this->getAttribute(isset($context["request"]) ? $context["request"] : $this->getContext($context, "request"), "basePath", array())), "html", null, true);
         echo ");\n                    }\n\n                    if (path.substr(0, 1) === '/' && !path.match(new RegExp(";
         // line 227
         echo twig_jsonencode_filter(isset($context["excluded_ajax_paths"]) ? $context["excluded_ajax_paths"] : $this->getContext($context, "excluded_ajax_paths"));
         echo "))) {\n                        var stackElement = {\n                            loading: true,\n                            error: false,\n                            url: url,\n                            method: method,\n                            start: new Date()\n                        };\n\n                        requestStack.push(stackElement);\n\n                        this.addEventListener('readystatechange', function() {\n                            if (self.readyState == 4) {\n                                stackElement.duration = new Date() - stackElement.start;\n                                stackElement.loading = false;\n                                stackElement.error = self.status < 200 || self.status >= 400;\n                                stackElement.profile = self.getResponseHeader(\"X-Debug-Token\");\n                                stackElement.profilerUrl = self.getResponseHeader(\"X-Debug-Token-Link\");\n\n                                Sfjs.renderAjaxRequests();\n                            }\n                        }, false);\n\n                        Sfjs.renderAjaxRequests();\n                    }\n\n                    proxied.apply(this, Array.prototype.slice.call(arguments));\n                };\n            }\n        ";
     }
     // line 257
     echo "\n        return {\n            hasClass: hasClass,\n\n            removeClass: removeClass,\n\n            addClass: addClass,\n\n            toggleClass: toggleClass,\n\n            getPreference: getPreference,\n\n            setPreference: setPreference,\n\n            addEventListener: addEventListener,\n\n            request: request,\n\n            renderAjaxRequests: renderAjaxRequests,\n\n            load: function(selector, url, onSuccess, onError, options) {\n                var el = document.getElementById(selector);\n\n                if (el && el.getAttribute('data-sfurl') !== url) {\n                    request(\n                        url,\n                        function(xhr) {\n                            el.innerHTML = xhr.responseText;\n                            el.setAttribute('data-sfurl', url);\n                            removeClass(el, 'loading');\n                            (onSuccess || noop)(xhr, el);\n                        },\n                        function(xhr) { (onError || noop)(xhr, el); },\n                        '',\n                        options\n                    );\n                }\n\n                return this;\n            },\n\n            toggle: function(selector, elOn, elOff) {\n                var tmp = elOn.style.display,\n                    el = document.getElementById(selector);\n\n                elOn.style.display = elOff.style.display;\n                elOff.style.display = tmp;\n\n                if (el) {\n                    el.style.display = 'none' === tmp ? 'none' : 'block';\n                }\n\n                return this;\n            },\n\n            createTabs: function() {\n                var tabGroups = document.querySelectorAll('.sf-tabs');\n\n                /* create the tab navigation for each group of tabs */\n                for (var i = 0; i < tabGroups.length; i++) {\n                    var tabs = tabGroups[i].querySelectorAll('.tab');\n                    var tabNavigation = document.createElement('ul');\n                    tabNavigation.className = 'tab-navigation';\n\n                    for (var j = 0; j < tabs.length; j++) {\n                        var tabId = 'tab-' + i + '-' + j;\n                        var tabTitle = tabs[j].querySelector('.tab-title').innerHTML;\n\n                        var tabNavigationItem = document.createElement('li');\n                        tabNavigationItem.setAttribute('data-tab-id', tabId);\n                        if (j == 0) { Sfjs.addClass(tabNavigationItem, 'active'); }\n                        if (Sfjs.hasClass(tabs[j], 'disabled')) { Sfjs.addClass(tabNavigationItem, 'disabled'); }\n                        tabNavigationItem.innerHTML = tabTitle;\n                        tabNavigation.appendChild(tabNavigationItem);\n\n                        var tabContent = tabs[j].querySelector('.tab-content');\n                        tabContent.parentElement.setAttribute('id', tabId);\n                    }\n\n                    tabGroups[i].insertBefore(tabNavigation, tabGroups[i].firstChild);\n                }\n\n                /* display the active tab and add the 'click' event listeners */\n                for (i = 0; i < tabGroups.length; i++) {\n                    tabNavigation = tabGroups[i].querySelectorAll('.tab-navigation li');\n\n                    for (j = 0; j < tabNavigation.length; j++) {\n                        tabId = tabNavigation[j].getAttribute('data-tab-id');\n                        document.getElementById(tabId).querySelector('.tab-title').className = 'hidden';\n\n                        if (Sfjs.hasClass(tabNavigation[j], 'active')) {\n                            document.getElementById(tabId).className = 'block';\n                        } else {\n                            document.getElementById(tabId).className = 'hidden';\n                        }\n\n                        tabNavigation[j].addEventListener('click', function(e) {\n                            var activeTab = e.target || e.srcElement;\n\n                            /* needed because when the tab contains HTML contents, user can click */\n                            /* on any of those elements instead of their parent '<li>' element */\n                            while (activeTab.tagName.toLowerCase() !== 'li') {\n                                activeTab = activeTab.parentNode;\n                            }\n\n                            /* get the full list of tabs through the parent of the active tab element */\n                            var tabNavigation = activeTab.parentNode.children;\n                            for (var k = 0; k < tabNavigation.length; k++) {\n                                var tabId = tabNavigation[k].getAttribute('data-tab-id');\n                                document.getElementById(tabId).className = 'hidden';\n                                Sfjs.removeClass(tabNavigation[k], 'active');\n                            }\n\n                            Sfjs.addClass(activeTab, 'active');\n                            var activeTabId = activeTab.getAttribute('data-tab-id');\n                            document.getElementById(activeTabId).className = 'block';\n                        });\n                    }\n                }\n            },\n\n            createToggles: function() {\n                var toggles = document.querySelectorAll('.sf-toggle');\n\n                for (var i = 0; i < toggles.length; i++) {\n                    var elementSelector = toggles[i].getAttribute('data-toggle-selector');\n                    var element = document.querySelector(elementSelector);\n\n                    Sfjs.addClass(element, 'sf-toggle-content');\n\n                    if (toggles[i].hasAttribute('data-toggle-initial') && toggles[i].getAttribute('data-toggle-initial') == 'display') {\n                        Sfjs.addClass(element, 'sf-toggle-visible');\n                    } else {\n                        Sfjs.addClass(element, 'sf-toggle-hidden');\n                    }\n\n                    Sfjs.addEventListener(toggles[i], 'click', function(e) {\n                        e.preventDefault();\n\n                        var toggle = e.target || e.srcElement;\n\n                        /* needed because when the toggle contains HTML contents, user can click */\n                        /* on any of those elements instead of their parent '.sf-toggle' element */\n                        while (!Sfjs.hasClass(toggle, 'sf-toggle')) {\n                            toggle = toggle.parentNode;\n                        }\n\n                        var element = document.querySelector(toggle.getAttribute('data-toggle-selector'));\n\n                        Sfjs.toggleClass(element, 'sf-toggle-hidden');\n                        Sfjs.toggleClass(element, 'sf-toggle-visible');\n\n                        /* the toggle doesn't change its contents when clicking on it */\n                        if (!toggle.hasAttribute('data-toggle-alt-content')) {\n                            return;\n                        }\n\n                        if (!toggle.hasAttribute('data-toggle-original-content')) {\n                            toggle.setAttribute('data-toggle-original-content', toggle.innerHTML);\n                        }\n\n                        var currentContent = toggle.innerHTML;\n                        var originalContent = toggle.getAttribute('data-toggle-original-content');\n                        var altContent = toggle.getAttribute('data-toggle-alt-content');\n                        toggle.innerHTML = currentContent !== altContent ? altContent : originalContent;\n                    });\n                }\n            }\n        };\n    })();\n\n    Sfjs.addEventListener(window, 'load', function() {\n        Sfjs.createTabs();\n        Sfjs.createToggles();\n    });\n\n/*]]>*/</script>\n";
     $__internal_b3a06b7d0e322b7e3a01f7ab3182288c77c6940258883e2ae9f5f2edc60fec34->leave($__internal_b3a06b7d0e322b7e3a01f7ab3182288c77c6940258883e2ae9f5f2edc60fec34_prof);
 }
开发者ID:MikeVeerman,项目名称:symf2tut,代码行数:32,代码来源:71f94766af0a085ccc998d9b85197568ad46ccf991b5dce1dadb34a6295af029.php


示例10: block_content

 public function block_content($context, array $blocks = array())
 {
     // line 10
     echo "<table class=\"records_list table table-hover table-striped table-bordered table-condensed\">\n        <thead>\n            <tr>\n                <th>Id</th>\n                <th>Nombre</th>\n                <th>Actions</th>\n            </tr>\n        </thead>\n        <tbody>\n        ";
     // line 19
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable(isset($context["entities"]) ? $context["entities"] : $this->getContext($context, "entities"));
     foreach ($context['_seq'] as $context["_key"] => $context["entity"]) {
         // line 20
         echo "            <tr>\n                <td><a href=\"";
         // line 21
         echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("clasificadoretapa_show", array("id" => $this->getAttribute(isset($context["entity"]) ? $context["entity"] : $this->getContext($context, "entity"), "id"))), "html", null, true);
         echo "\">";
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["entity"]) ? $context["entity"] : $this->getContext($context, "entity"), "id"), "html", null, true);
         echo "</a></td>\n                <td>";
         // line 22
         echo twig_escape_filter($this->env, $this->getAttribute(isset($context["entity"]) ? $context["entity"] : $this->getContext($context, "entity"), "nombre"), "html", null, true);
         echo "</td>\n                <td>\n                <ul>\n                    <li>\n                        <a href=\"";
         // line 26
         echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("clasificadoretapa_show", array("id" => $this->getAttribute(isset($context["entity"]) ? $context["entity"] : $this->getContext($context, "entity"), "id"))), "html", null, true);
         echo "\">show</a>\n                    </li>\n                    <li>\n                        <a href=\"";
         // line 29
         echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("clasificadoretapa_edit", array("id" => $this->getAttribute(isset($context["entity"]) ? $context["entity"] : $this->getContext($context, "entity"), "id"))), "html", null, true);
         echo "\">edit</a>\n                    </li>\n                </ul>\n                </td>\n            </tr>\n        ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entity'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 35
     echo "        </tbody>\n    </table>\n\n        <ul>\n        <li>\n            <a href=\"";
     // line 40
     echo $this->env->getExtension('routing')->getPath("clasificadoretapa_new");
     echo "\">\n                Create a new entry\n            </a>\n        </li>\n    </ul>\n    ";
 }
开发者ID:admarin1985,项目名称:tickets,代码行数:34,代码来源:c712d99219a1087b4c6b596b40594b4a5d9844a3f42e8c47dd183d0068a0.php


示例11: doDisplay

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP twig_first函数代码示例发布时间:2022-05-23
下一篇:
PHP twig_ensure_traversable函数代码示例发布时间: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