本文整理汇总了PHP中twig_first函数的典型用法代码示例。如果您正苦于以下问题:PHP twig_first函数的具体用法?PHP twig_first怎么用?PHP twig_first使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了twig_first函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_091399f3bbd64d2b3cad8091de389c4fbb06bc591d3e67eb9ae2ac076ddcb9e8_prof);
}
开发者ID:Vysotskyi,项目名称:AngularREST,代码行数:71,代码来源:22838c7c765e65554dc5c5bff757c43757f3ba55407e8334e0704a91bb4c2ed6.php
示例10: doDisplay
protected function doDisplay(array $context, array $blocks = array())
{
// line 1
echo "<div class=\"list-item\">\n\n <div class=\"list-blog-header\">\n <span class=\"list-blog-date\">\n <span>";
// line 5
echo twig_date_format_filter($this->env, $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "date", array()), "d");
echo "</span>\n <em>";
// line 6
echo twig_date_format_filter($this->env, $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "date", array()), "M");
echo "</em>\n </span>\n ";
// line 8
if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "link", array())) {
// line 9
echo " <h4>\n ";
// line 10
if (!($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "continue_link", array()) === false)) {
// line 11
echo " <a href=\"";
echo $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "url", array());
echo "\"><i class=\"fa fa-angle-double-right\"></i></a>\n ";
}
// line 13
echo " <a href=\"";
echo $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "link", array());
echo "\">";
echo $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "title", array());
echo "</a>\n </h4>\n ";
} else {
// line 16
echo " <h4><a href=\"";
echo $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "url", array());
echo "\">";
echo $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "title", array());
echo "</a></h4>\n ";
}
// line 18
echo "\n ";
// line 19
if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "taxonomy", array()), "tag", array())) {
// line 20
echo " <span class=\"tags\">\n ";
// line 21
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "taxonomy", array()), "tag", array()));
foreach ($context['_seq'] as $context["_key"] => $context["tag"]) {
// line 22
echo " <a href=\"";
echo $this->getAttribute(isset($context["blog"]) ? $context["blog"] : null, "url", array());
echo "/tag";
echo $this->getAttribute($this->getAttribute(isset($context["config"]) ? $context["config"] : null, "system", array()), "param_sep", array());
echo $context["tag"];
echo "\">";
echo $context["tag"];
echo "</a>\n ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['tag'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 24
echo " </span>\n ";
}
// line 26
echo " ";
if (isset($context["big_header"]) ? $context["big_header"] : null) {
// line 27
echo " ";
echo $this->getAttribute($this->getAttribute(twig_first($this->env, $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "media", array()), "images", array())), "cropResize", array(0 => 900, 1 => 600), "method"), "html", array());
echo "\n ";
} else {
// line 29
echo " ";
echo $this->getAttribute($this->getAttribute(twig_first($this->env, $this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "media", array()), "images", array())), "cropZoom", array(0 => 900, 1 => 300), "method"), "html", array());
echo "\n ";
}
// line 31
echo "\n </div>\n\n <div class=\"list-blog-padding\">\n\n ";
// line 36
if ($this->getAttribute($this->getAttribute(isset($context["page"]) ? $context["page"] : null, "header", array()), "continue_link", array()) === false) {
// line 37
echo " <p>";
echo $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "content", array());
echo "</p>\n ";
// line 38
if (!(isset($context["truncate"]) ? $context["truncate"] : null)) {
// line 39
echo " ";
$context["show_prev_next"] = true;
// line 40
echo " ";
}
// line 41
echo " ";
} elseif ((isset($context["truncate"]) ? $context["truncate"] : null) && $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "summary", array()) != $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "content", array())) {
// line 42
echo " <p>";
echo $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "summary", array());
echo "</p>\n <p><a href=\"";
// line 43
echo $this->getAttribute(isset($context["page"]) ? $context["page"] : null, "url", array());
echo "\">Continue Reading...</a></p>\n ";
//.........这里部分代码省略.........
开发者ID:Blind3y3Design,项目名称:sitch.co-documentation,代码行数:101,代码来源:e62c4a294a95a94c98d1690f19e141ab070ae9af496a836a5a92d7d5a57401d0.php
示例11: block_form_errors
public function block_form_errors($context, array $blocks = array())
{
// line 316
echo " ";
$context["error_count"] = twig_length_filter($this->env, isset($context["errors"]) ? $context["errors"] : null);
// line 317
echo " ";
if ((isset($context["error_count"]) ? $context["error_count"] : null) >= 1) {
// line 318
echo " <div class=\"error-block\">\n <span class=\"label label-danger\">";
// line 319
echo twig_escape_filter($this->env, $this->env->getExtension('translator')->transchoice("errors", isset($context["error_count"]) ? $context["error_count"] : null, array(), "EasyAdminBundle"), "html", null, true);
echo "</span>\n ";
// line 320
if ((isset($context["error_count"]) ? $context["error_count"] : null) == 1) {
// line 321
echo " ";
echo twig_escape_filter($this->env, $this->getAttribute(twig_first($this->env, isset($context["errors"]) ? $context["errors"] : null), "message", array()), "html", null, true);
echo "\n ";
} else {
// line 323
echo " <ul>\n ";
// line 324
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(isset($context["errors"]) ? $context["errors"] : null);
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 325
echo " <li>";
echo twig_escape_filter($this->env, $this->getAttribute($context["error"], "message", array()), "html", null, true);
echo "</li>\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 327
echo " </ul>\n ";
}
// line 329
echo " </div>\n ";
}
}
开发者ID:karolskora1993,项目名称:strona-przedszkola,代码行数:41,代码来源:9a8e63f95018943b5090a96c6a56b8894a49170923fd2126ba6bb4e1673133ec.php
示例12: block_content
public function block_content($context, array $blocks = array())
{
// line 18
echo "<form action=\"\" method=\"post\">\n ";
// line 19
if ($this->getAttribute(isset($context["errors"]) ? $context["errors"] : null, "timeUnavailable", array(), "any", true, true)) {
// line 20
echo " <span class=\"error\">";
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["errors"]) ? $context["errors"] : null, "timeUnavailable", array()), "html", null, true);
echo "</span><br>\n ";
}
// line 22
echo " ";
// line 23
echo " ";
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["errors"]) ? $context["errors"] : null, "employee_id", array()));
foreach ($context['_seq'] as $context["_key"] => $context["error"]) {
// line 24
echo " <span class=\"error\">";
echo twig_escape_filter($this->env, $context["error"], "html", null, true);
echo "</span><br>\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 26
echo " ";
if (twig_test_iterable(isset($context["creator"]) ? $context["creator"] : null)) {
// line 27
echo " <select name=\"employee_id\" class=\"input\">\n ";
// line 28
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable(isset($context["creator"]) ? $context["creator"] : null);
$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["person"]) {
// line 29
echo " ";
if ($this->getAttribute($context["loop"], "first", array())) {
// line 30
echo " <option value=\"";
echo twig_escape_filter($this->env, $this->getAttribute($context["person"], "id", array()), "html", null, true);
echo "\"";
if ($this->getAttribute(isset($context["values"]) ? $context["values"] : null, "employee_id", array()) == $this->getAttribute($context["person"], "id", array())) {
echo " selected";
}
echo ">Me</option>\n ";
} else {
// line 32
echo " <option value=\"";
echo twig_escape_filter($this->env, $this->getAttribute($context["person"], "id", array()), "html", null, true);
echo "\"";
if ($this->getAttribute(isset($context["values"]) ? $context["values"] : null, "employee_id", array()) == $this->getAttribute($context["person"], "id", array())) {
echo " selected";
}
echo ">";
echo twig_escape_filter($this->env, $this->getAttribute($context["person"], "last_name", array()), "html", null, true);
echo ", ";
echo twig_escape_filter($this->env, $this->getAttribute($context["person"], "first_name", array()), "html", null, true);
if (!twig_test_empty($this->getAttribute($context["person"], "middle_name", array()))) {
echo " ";
echo twig_escape_filter($this->env, twig_first($this->env, $this->getAttribute($context["person"], "middle_name", array())), "html", null, true);
echo ".";
}
echo "</option>\n ";
}
// line 34
echo " ";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['person'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 35
echo " </select><br>\n ";
} else {
// line 37
echo " <input type=\"hidden\" name=\"employee_id\" value=\"";
echo twig_escape_filter($this->env, isset($context["creator"]) ? $context["creator"] : null, "html", null, true);
echo "\">\n ";
}
// line 39
echo " ";
// line 40
echo " ";
$context['_parent'] = (array) $context;
//.........这里部分代码省略.........
开发者ID:adiachenko,项目名称:booker,代码行数:101,代码来源:dc8398e6f5c6fec324abc8e1056f1beacad6d8989499215b7c134c84e9ef.php
示例13: doDisplay
protected function doDisplay(array $context, array $blocks = array())
{
$tags = array("set" => 29, "for" => 44, "if" => 54);
$filters = array("t" => 30, "length" => 57, "first" => 64);
$functions = array();
try {
$this->env->getExtension('sandbox')->checkSecurity(array('set', 'for', 'if'), array('t', 'length', 'first'), array());
} catch (Twig_Sandbox_SecurityError $e) {
$e->setTemplateFile($this->getTemplateName());
if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
// line 29
$context["status_heading"] = array("status" => t("Status message"), "error" => t("Error message"), "warning" => t("Warning message"), "info" => t("Informative message"));
// line 37
$context["status_classes"] = array("status" => "success", "error" => "danger", "warning" => "warning", "info" => "info");
// line 44
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(isset($context["message_list"]) ? $context["message_list"] : null);
foreach ($context['_seq'] as $context["type"] => $context["messages"]) {
// line 46
$context["classes"] = array(0 => "alert", 1 => "alert-" . $this->getAttribute(isset($context["status_classes"]) ? $context["status_classes"] : null, $context["type"], array(), "array"), 2 => "alert-dismissible");
// line 52
echo "<div";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
echo " role=\"alert\">\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button>\n ";
// line 54
if ($this->getAttribute(isset($context["status_headings"]) ? $context["status_headings"] : null, $context["type"], array(), "array")) {
// line 55
echo " <h4 class=\"sr-only\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["status_headings"]) ? $context["status_headings"] : null, $context["type"], array(), "array"), "html", null, true));
echo "</h4>\n ";
}
// line 57
echo " ";
if (twig_length_filter($this->env, $context["messages"]) > 1) {
// line 58
echo " <ul class=\"item-list item-list--messages\">\n ";
// line 59
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($context["messages"]);
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 60
echo " <li class=\"item item--message\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $context["message"], "html", null, true));
echo "</li>\n ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 62
echo " </ul>\n ";
} else {
// line 64
echo " ";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, twig_first($this->env, $context["messages"]), "html", null, true));
echo "\n ";
}
// line 66
echo "</div>\n";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['type'], $context['messages'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
}
开发者ID:evmorfia-b,项目名称:feelmybook,代码行数:71,代码来源:4a753ac8c76469e46ee42a5df016d344c9513df6c6ec7eb14b88385d5acfa7e0.php
示例14: doDisplay
protected function doDisplay(array $context, array $blocks = array())
{
$tags = array("for" => 28, "set" => 30, "if" => 37);
$filters = array("length" => 45, "first" => 52);
$functions = array();
try {
$this->env->getExtension('sandbox')->checkSecurity(array('for', 'set', 'if'), array('length', 'first'), array());
} catch (Twig_Sandbox_SecurityError $e) {
$e->setTemplateFile($this->getTemplateName());
if ($e instanceof Twig_Sandbox_SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
$e->setTemplateLine($tags[$e->getTagName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
$e->setTemplateLine($filters[$e->getFilterName()]);
} elseif ($e instanceof Twig_Sandbox_SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
$e->setTemplateLine($functions[$e->getFunctionName()]);
}
throw $e;
}
// line 28
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(isset($context["message_list"]) ? $context["message_list"] : null);
foreach ($context['_seq'] as $context["type"] => $context["messages"]) {
// line 29
echo " ";
// line 30
$context["classes"] = array(0 => "messages", 1 => "messages--" . $context["type"]);
// line 35
echo " <div class=\"";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute($this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "addClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "class", array()), "html", null, true));
echo "\" role=\"contentinfo\" aria-label=\"";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["status_headings"]) ? $context["status_headings"] : null, $context["type"], array(), "array"), "html", null, true));
echo "\">\n\n <div class=\"messages__container\"";
// line 37
if ($context["type"] == "error") {
echo " role=\"alert\"";
}
echo ">\n\n ";
// line 39
if ($this->getAttribute(isset($context["status_headings"]) ? $context["status_headings"] : null, $context["type"], array(), "array")) {
// line 40
echo " <h2 class=\"visually-hidden\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["status_headings"]) ? $context["status_headings"] : null, $context["type"], array(), "array"), "html", null, true));
echo "</h2>\n ";
}
// line 42
echo "\n <span class=\"icon icon-";
// line 43
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $context["type"], "html", null, true));
echo "\" aria-hidden=\"true\"></span>\n\n ";
// line 45
if (twig_length_filter($this->env, $context["messages"]) > 1) {
// line 46
echo " <ul class=\"messages__list\">\n ";
// line 47
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($context["messages"]);
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 48
echo " <li class=\"messages__item\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $context["message"], "html", null, true));
echo "</li>\n ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 50
echo " </ul>\n ";
} else {
// line 52
echo " <div class=\"messages__list\">";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, twig_first($this->env, $context["messages"]), "html", null, true));
echo "</div>\n ";
}
// line 54
echo "\n </div>\n\n </div>\n ";
// line 59
echo " ";
echo $this->env->getExtension('sandbox')->ensureToStringAllowed($this->env->getExtension('drupal_core')->escapeFilter($this->env, $this->getAttribute(isset($context["attributes"]) ? $context["attributes"] : null, "removeClass", array(0 => isset($context["classes"]) ? $context["classes"] : null), "method"), "html", null, true));
echo "\n";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['type'], $context['messages'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
}
开发者ID:neetumorwani,项目名称:blogging,代码行数:84,代码来源:8d6f8dc0c0405c742a4c9e48699da0837dca7012b208238ae3d94552de4bee47.php
示例15: block_panel
//.........这里部分代码省略.........
} else {
// line 118
echo " <div class=\"empty\">\n <p>The security component is disabled.</p>\n </div>\n ";
}
// line 122
echo "\n ";
// line 123
if (!twig_test_empty($this->getAttribute($context["collector"] ?? null, "voters", array(), "any", true, true) ? _twig_default_filter($this->getAttribute($context["collector"] ?? null, "voters", array()), array()) : array())) {
// line 124
echo " <h2>Security Voters <small>(";
echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute($context["collector"] ?? $this->getContext($context, "collector"), "voters", array())), "html", null, true);
echo ")</small></h2>\n\n <div class=\"metrics\">\n <div class=\"metric\">\n <span class=\"value\">";
// line 128
echo twig_escape_filter($this->env, $this->getAttribute($context["collector"] ?? null, "voterStrategy", array(), "any", true, true) ? _twig_default_filter($this->getAttribute($context["collector"] ?? null, "voterStrategy", array()), "unknown") : "unknown", "html", null, true);
echo "</span>\n <span class=\"label\">Strategy</span>\n </div>\n </div>\n\n <table class=\"voters\">\n <thead>\n <tr>\n <th>#</th>\n <th>Voter class</th>\n </tr>\n </thead>\n\n <tbody>\n ";
// line 142
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute($context["collector"] ?? $this->getContext($context, "collector"), "voters", array()));
$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["voter"]) {
// line 143
echo " <tr>\n <td class=\"font-normal text-small text-muted nowrap\">";
// line 144
echo twig_escape_filter($this->env, $this->getAttribute($context["loop"], "index", array()), "html", null, true);
echo "</td>\n <td class=\"font-normal\">";
// line 145
echo twig_escape_filter($this->env, $context["voter"], "html", null, true);
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['voter'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 148
echo " </tbody>\n </table>\n ";
}
// line 151
echo "\n ";
// line 152
if (!twig_test_empty($this->getAttribute($context["collector"] ?? null, "accessDecisionLog", array(), "any", true, true) ? _twig_default_filter($this->getAttribute($context["collector"] ?? null, "accessDecisionLog", array()), array()) : array())) {
// line 153
echo " <h2>Access decision log</h2>\n\n <table class=\"decision-log\">\n <col style=\"width: 30px\">\n <col style=\"width: 120px\">\n <col style=\"width: 25%\">\n <col style=\"width: 60%\">\n\n <thead>\n <tr>\n <th>#</th>\n <th>Result</th>\n <th>Attributes</th>\n <th>Object</th>\n </tr>\n </thead>\n\n <tbody>\n ";
// line 171
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute($context["collector"] ?? $this->getContext($context, "collector"), "accessDecisionLog", array()));
$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["decision"]) {
// line 172
echo " <tr>\n <td class=\"font-normal text-small text-muted nowrap\">";
// line 173
echo twig_escape_filter($this->env, $this->getAttribute($context["loop"], "index", array()), "html", null, true);
echo "</td>\n <td class=\"font-normal\">\n ";
// line 175
echo $this->getAttribute($context["decision"], "result", array()) ? "<span class=\"label status-success same-width\">GRANTED</span>" : "<span class=\"label status-error same-width\">DENIED</span>";
// line 178
echo "\n </td>\n <td>";
// line 180
echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute($context["decision"], "attributes", array())) == 1 ? twig_first($this->env, $this->getAttribute($context["decision"], "attributes", array())) : $this->env->getExtension('Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension')->dumpValue($this->getAttribute($context["decision"], "attributes", array())), "html", null, true);
echo "</td>\n <td>";
// line 181
echo twig_escape_filter($this->env, $this->env->getExtension('Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension')->dumpValue($this->getAttribute($context["decision"], "object", array())), "html", null, true);
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['decision'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 184
echo " </tbody>\n </table>\n ";
}
$__internal_6664b02bc3841ca31ecd770e83d059e222953994e197eb0ce80ca8024533ab5a->leave($__internal_6664b02bc3841ca31ecd770e83d059e222953994e197eb0ce80ca8024533ab5a_prof);
}
开发者ID:BarloworldTransport,项目名称:BWTSupportWebTools,代码行数:101,代码来源:78ff041428672fde562e832dbdaf14e9ceae1054ab36f4dc449fe35e76f020b2.php