protected function doDisplay(array $context, array $blocks = array()) { // line 1 $context["updates"] = $this->getAttribute($this->getAttribute(isset($context["gantry"]) ? $context["gantry"] : null, "platform", array()), "updates", array()); // line 2 if (isset($context["updates"]) ? $context["updates"] : null) { // line 3 $context["version"] = twig_last($this->env, twig_split_filter($this->env, $this->getAttribute(isset($context["updates"]) ? $context["updates"] : null, 0, array()), " ")); // line 4 echo "<div class=\"g-grid\">\n <div class=\"g-block\">\n <div class=\"update-header clearfix\">\n <span class=\"update-text\">"; // line 7 echo twig_escape_filter($this->env, $this->env->getExtension('GantryTwig')->transFilter("GANTRY5_PLATFORM_UPDATES_AVAILABLE"), "html", null, true); echo ": "; echo twig_escape_filter($this->env, twig_join_filter(isset($context["updates"]) ? $context["updates"] : null, ", "), "html", null, true); echo "</span>\n <div class=\"update-tools\">\n <a href=\""; // line 9 echo $this->getAttribute($this->getAttribute(isset($context["gantry"]) ? $context["gantry"] : null, "platform", array()), "update", array()); echo "\" class=\"button button-update\"><i class=\"fa fa-refresh\"></i> <span>"; echo twig_escape_filter($this->env, $this->env->getExtension('GantryTwig')->transFilter("GANTRY5_PLATFORM_UPDATE"), "html", null, true); echo "</span></a>\n <a href=\"#\" data-changelog=\""; // line 10 echo twig_escape_filter($this->env, isset($context["version"]) ? $context["version"] : null, "html", null, true); echo "\" class=\"button button-update\"><i class=\"fa fa-book\"></i> <span>"; echo twig_escape_filter($this->env, $this->env->getExtension('GantryTwig')->transFilter("GANTRY5_PLATFORM_CHANGELOG"), "html", null, true); echo "</span></a>\n <a href=\"#\" class=\"fa fa-close\" data-g-close=\".g-grid\"></a>\n </div>\n </div>\n </div>\n</div>\n"; } }
protected function doDisplay(array $context, array $blocks = array()) { // line 1 if (array_key_exists("entities", $context)) { // line 2 echo " <header>نتایج جستجو برای: "; echo twig_escape_filter($this->env, isset($context["query"]) ? $context["query"] : $this->getContext($context, "query"), "html", null, true); echo "</header>\n "; // line 3 $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["book"]) { // line 4 echo " <article id=\"book\">\n <figure>\n "; // line 6 $context["cover"] = twig_last($this->env, twig_split_filter($this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "cover"), "/")); echo " \n "; // line 8 echo " <img src=\""; echo twig_escape_filter($this->env, $this->env->getExtension('liip_imagine')->filter(twig_join_filter(array(0 => "uploads/", 1 => isset($context["cover"]) ? $context["cover"] : $this->getContext($context, "cover"))), "my_thumb", true), "html", null, true); echo "\" />\n </figure>\n <figcaption> \n <div id=\"comments_num\" title=\""; // line 11 if ($this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum")) { echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum"), "html", null, true); echo " دیدگاه"; } else { echo "بدون دیدگاه"; } echo "\"><h3>"; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum"), "html", null, true); echo "</h3></div>\n <a href=\""; // line 12 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_show", array("id" => $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "link"))), "html", null, true); echo "\"><h1>"; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "name"), "html", null, true); echo "</h1></a>\n <h3>"; // line 13 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "author"), "html", null, true); echo "</h3>\n <a href=\""; // line 14 echo twig_escape_filter($this->env, twig_join_filter(array(0 => "uploads/", 1 => $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "file"))), "html", null, true); echo "\"><button type=\"button\" class=\"btn btn-info\">دریافت</button></a>\n </figcaption>\n </article> \n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['book'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 18 echo " <div id=\"clr\"></div>\n "; // line 19 echo $this->env->getExtension('knp_pagination')->render(isset($context["entities"]) ? $context["entities"] : $this->getContext($context, "entities")); echo "\n"; } else { // line 21 echo " "; $this->env->loadTemplate("ChakoshHomeBundle:Home:noresult_content.html.twig")->display($context); } // line 23 echo "\n"; }
public function block_content($context, array $blocks = array()) { // line 3 if (array_key_exists("category", $context)) { echo "<header><span class=\"glyphicon glyphicon-briefcase\"></span> آرشیو دسته ی: "; echo twig_escape_filter($this->env, isset($context["category"]) ? $context["category"] : $this->getContext($context, "category"), "html", null, true); echo "</header>"; } // line 4 $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["book"]) { // line 5 echo "<article id=\"book\">\n <figure>\n "; // line 7 $context["cover"] = twig_last($this->env, twig_split_filter($this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "cover"), "/")); // line 8 echo " "; // line 9 echo " <img src=\""; echo twig_escape_filter($this->env, $this->env->getExtension('liip_imagine')->filter(twig_join_filter(array(0 => "uploads/", 1 => isset($context["cover"]) ? $context["cover"] : $this->getContext($context, "cover"))), "my_thumb", true), "html", null, true); echo "\" />\n </figure>\n <figcaption> \n <div id=\"comments_num\" title=\""; // line 12 if ($this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum")) { echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum"), "html", null, true); echo " دیدگاه"; } else { echo "بدون دیدگاه"; } echo "\"><h3>"; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum"), "html", null, true); echo "</h3></div>\n <a href=\""; // line 13 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_show", array("id" => $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "link"))), "html", null, true); echo "\"><h1>"; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "name"), "html", null, true); echo "</h1></a>\n <h3>"; // line 14 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "author"), "html", null, true); echo "</h3>\n <a href=\""; // line 15 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "file"), "html", null, true); echo "\"><button type=\"button\" class=\"btn btn-info\">دریافت</button></a>\n </figcaption>\n</article> \n"; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['book'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 19 echo "<div id=\"clr\"></div>\n"; // line 20 echo $this->env->getExtension('knp_pagination')->render(isset($context["entities"]) ? $context["entities"] : $this->getContext($context, "entities")); echo "\n<script type=\"text/javascript\">\n\n</script>\n"; }
public function block_content($context, array $blocks = array()) { // line 50 echo " <header>\n <h3>"; // line 51 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "name"), "html", null, true); echo "</h3>\n <h3> | </h3>\n <h3>"; // line 53 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "author"), "html", null, true); echo "</h3>\n <div id=\"category\">\n "; // line 55 $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable(isset($context["category"]) ? $context["category"] : $this->getContext($context, "category")); $context['_iterated'] = false; foreach ($context['_seq'] as $context["_key"] => $context["cat"]) { // line 56 echo " <a href=\""; echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("category_show", array("category" => $this->getAttribute(isset($context["cat"]) ? $context["cat"] : $this->getContext($context, "cat"), "name"))), "html", null, true); echo "\">\n <span class=\"label label-success\">"; // line 57 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["cat"]) ? $context["cat"] : $this->getContext($context, "cat"), "name"), "html", null, true); echo "</span>\n </a>\n "; $context['_iterated'] = true; } if (!$context['_iterated']) { // line 60 echo " <span class=\"label label-success\">دسته بندی نشده</span>\n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cat'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 62 echo " </div>\n </header>\n <a class=\"image-popup-no-margins\" href=\""; // line 64 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "cover"), "html", null, true); echo "\">\n <div id=\"cover_image\">\n <figure id=\"single\">\n "; // line 67 $context["cover"] = twig_last($this->env, twig_split_filter($this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "cover"), "/")); // line 68 echo " <img src=\""; echo twig_escape_filter($this->env, $this->env->getExtension('liip_imagine')->filter(twig_join_filter(array(0 => "uploads/", 1 => isset($context["cover"]) ? $context["cover"] : $this->getContext($context, "cover"))), "my_thumb"), "html", null, true); echo "\" />\n <div id=\"download\">\n <a href=\""; // line 70 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "file"), "html", null, true); echo "\"><button type=\"submit\" class=\"btn btn-info\" />دریافت</button></a>\n </div>\n </figure>\n </div> \n </a>\n \n <footer id=\"single-footer\"> \n <p>"; // line 77 echo $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "content"); echo "</p>\n </footer>\n <div id=\"clr\"></div>\n "; // line 80 $this->env->loadTemplate("ChakoshHomeBundle:Base:comments.html.twig")->display(array_merge($context, isset($context["comment"]) ? $context["comment"] : $this->getContext($context, "comment"))); }
public function block_content($context, array $blocks = array()) { // line 3 echo "<section class=\"row\">\n <div class=\"col-md-3\">\n </div>\n <div class=\"col-md-3\"></div>\n <div class=\"col-md-3\"></div>\n <div class=\"col-md-3\">\n <a href=\""; // line 9 echo $this->env->getExtension('routing')->getPath("admin_new"); echo "\"><button type=\"button\" class=\"btn btn-primary\"><span class=\"fa-plus\"></span> جدید</button></a>\n </div>\n</section>\n<section>\n <table class=\"table\">\n <thead>\n <tr>\n <th>کاور</th>\n <th>دیدگاه</th>\n <th>نام</th>\n <th>نویسنده</th>\n </tr>\n </thead>\n <tbody>\n "; // line 23 $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["book"]) { // line 24 echo " "; $context["cover"] = twig_last($this->env, twig_split_filter($this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "cover"), "/")); // line 25 echo " <tr>\n <td><img src=\""; // line 26 echo twig_escape_filter($this->env, $this->env->getExtension('liip_imagine')->filter(twig_join_filter(array(0 => "uploads/", 1 => isset($context["cover"]) ? $context["cover"] : $this->getContext($context, "cover"))), "small", true), "html", null, true); echo "\" /></td>\n <td>"; // line 27 if ($this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum")) { echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "commentNum"), "html", null, true); echo " دیدگاه"; } else { echo "بدون دیدگاه"; } echo "</td>\n <td><a href=\""; // line 28 echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("admin_edit", array("id" => $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "id"))), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "name"), "html", null, true); echo "</a></td>\n <td>"; // line 29 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["book"]) ? $context["book"] : $this->getContext($context, "book"), "author"), "html", null, true); echo "</td>\n </tr>\n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['book'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 32 echo " </tbody>\n </table>\n</section>\n"; // line 35 echo $this->env->getExtension('knp_pagination')->render(isset($context["entities"]) ? $context["entities"] : $this->getContext($context, "entities")); echo "\n"; }
public function block_page_content($context, array $blocks = array()) { // line 20 echo "\n <div class=\"page-header\">\n <h1>"; // line 22 echo twig_escape_filter($this->env, twig_last($this->env, twig_split_filter($this->env, $this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "name", array()), "\\")), "html", null, true); echo "</h1>\n <span class=\"pull-right>Edit "; // line 23 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "name", array()), "html", null, true); echo "</span>\n </div>\n\n <p>"; // line 26 $this->displayBlock("class_signature", $context, $blocks); echo "</p>\n\n "; // line 28 if ($this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "shortdesc", array()) || $this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "longdesc", array())) { // line 29 echo " <div class=\"description\">\n "; // line 30 if ($this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "shortdesc", array())) { // line 31 echo "<p>"; echo $this->env->getExtension('sami')->parseDesc($context, $this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "shortdesc", array()), isset($context["class"]) ? $context["class"] : $this->getContext($context, "class")); echo "</p>"; } // line 33 echo " "; if ($this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "longdesc", array())) { // line 34 echo "<p>"; echo $this->env->getExtension('sami')->parseDesc($context, $this->getAttribute(isset($context["class"]) ? $context["class"] : $this->getContext($context, "class"), "longdesc", array()), isset($context["class"]) ? $context["class"] : $this->getContext($context, "class")); echo "</p>"; } // line 36 echo " </div>\n "; } // line 38 echo "\n "; // line 39 if (isset($context["traits"]) ? $context["traits"] : $this->getContext($context, "traits")) { // line 40 echo " <h2>Traits</h2>\n\n "; // line 42 echo $context["__internal_7d195477799f982fd3814126484790b95253529c17cb67f66e9c4004134f5530"]->getrender_classes(isset($context["traits"]) ? $context["traits"] : $this->getContext($context, "traits")); echo "\n "; } // line 44 echo "\n "; // line 45 if (isset($context["constants"]) ? $context["constants"] : $this->getContext($context, "constants")) { // line 46 echo " <h2>Constants</h2>\n\n "; // line 48 $this->displayBlock("constants", $context, $blocks); echo "\n "; } // line 50 echo "\n "; // line 51 if (isset($context["properties"]) ? $context["properties"] : $this->getContext($context, "properties")) { // line 52 echo " <h2>Properties</h2>\n\n "; // line 54 $this->displayBlock("properties", $context, $blocks); echo "\n "; } // line 56 echo "\n "; // line 57 if (isset($context["methods"]) ? $context["methods"] : $this->getContext($context, "methods")) { // line 58 echo " <h2>Methods</h2>\n\n "; // line 60 $this->displayBlock("methods", $context, $blocks); echo "\n\n <h2>Details</h2>\n\n "; // line 64 $this->displayBlock("methods_details", $context, $blocks); echo "\n "; } // line 66 echo "\n"; }
public function getrender_log_message($__log_index__ = null, $__log__ = null, $__is_deprecation__ = false) { $context = $this->env->mergeGlobals(array("log_index" => $__log_index__, "log" => $__log__, "is_deprecation" => $__is_deprecation__, "varargs" => func_num_args() > 3 ? array_slice(func_get_args(), 3) : array())); $blocks = array(); ob_start(); try { $__internal_07f279c7df176c5a3e1446c7bd0bb83a9454032563e18984a59759be11176211 = $this->env->getExtension("native_profiler"); $__internal_07f279c7df176c5a3e1446c7bd0bb83a9454032563e18984a59759be11176211->enter($__internal_07f279c7df176c5a3e1446c7bd0bb83a9454032563e18984a59759be11176211_prof = new Twig_Profiler_Profile($this->getTemplateName(), "macro", "render_log_message")); // line 171 echo " "; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "message", array()), "html", null, true); echo "\n\n "; // line 173 if (isset($context["is_deprecation"]) ? $context["is_deprecation"] : $this->getContext($context, "is_deprecation")) { // line 174 echo " "; $context["stack"] = $this->getAttribute($this->getAttribute(isset($context["log"]) ? $context["log"] : null, "context", array(), "any", false, true), "stack", array(), "any", true, true) ? _twig_default_filter($this->getAttribute($this->getAttribute(isset($context["log"]) ? $context["log"] : null, "context", array(), "any", false, true), "stack", array()), array()) : array(); // line 175 echo " "; $context["id"] = "sf-call-stack-" . (isset($context["log_index"]) ? $context["log_index"] : $this->getContext($context, "log_index")); // line 176 echo "\n "; // line 177 if ($this->getAttribute($this->getAttribute(isset($context["log"]) ? $context["log"] : null, "context", array(), "any", false, true), "errorCount", array(), "any", true, true)) { // line 178 echo " <span class=\"text-small text-bold\">("; echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "context", array()), "errorCount", array()), "html", null, true); echo " times)</span>\n "; } // line 180 echo "\n "; // line 181 if (isset($context["stack"]) ? $context["stack"] : $this->getContext($context, "stack")) { // line 182 echo " <button class=\"btn-link text-small sf-toggle\" data-toggle-selector=\"#"; echo twig_escape_filter($this->env, isset($context["id"]) ? $context["id"] : $this->getContext($context, "id"), "html", null, true); echo "\" data-toggle-alt-content=\"Hide stack trace\">Show stack trace</button>\n "; } // line 184 echo "\n "; // line 185 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(isset($context["stack"]) ? $context["stack"] : $this->getContext($context, "stack")); foreach ($context['_seq'] as $context["index"] => $context["call"]) { if ($context["index"] > 1) { // line 186 echo " "; if ($context["index"] == 2) { // line 187 echo " <ul class=\"sf-call-stack hidden\" id=\""; echo twig_escape_filter($this->env, isset($context["id"]) ? $context["id"] : $this->getContext($context, "id"), "html", null, true); echo "\">\n "; } // line 189 echo "\n "; // line 190 if ($this->getAttribute($context["call"], "class", array(), "any", true, true)) { // line 191 echo " "; $context["from"] = $this->env->getExtension('code')->abbrClass($this->getAttribute($context["call"], "class", array())) . "::" . $this->env->getExtension('code')->abbrMethod($this->getAttribute($context["call"], "function", array())); // line 192 echo " "; } elseif ($this->getAttribute($context["call"], "function", array(), "any", true, true)) { // line 193 echo " "; $context["from"] = $this->env->getExtension('code')->abbrMethod($this->getAttribute($context["call"], "function", array())); // line 194 echo " "; } elseif ($this->getAttribute($context["call"], "file", array(), "any", true, true)) { // line 195 echo " "; $context["from"] = $this->getAttribute($context["call"], "file", array()); // line 196 echo " "; } else { // line 197 echo " "; $context["from"] = "-"; // line 198 echo " "; } // line 199 echo "\n "; // line 200 $context["file_name"] = $this->getAttribute($context["call"], "file", array(), "any", true, true) && $this->getAttribute($context["call"], "line", array(), "any", true, true) ? twig_last($this->env, twig_split_filter($this->env, twig_replace_filter($this->getAttribute($context["call"], "file", array()), array("\\" => "/")), "/")) : ""; // line 201 echo "\n <li>\n "; // line 203 echo isset($context["from"]) ? $context["from"] : $this->getContext($context, "from"); echo "\n "; // line 204 if (isset($context["file_name"]) ? $context["file_name"] : $this->getContext($context, "file_name")) { // line 205 echo " <span class=\"text-small\">(called from "; echo $this->env->getExtension('code')->formatFile($this->getAttribute($context["call"], "file", array()), $this->getAttribute($context["call"], "line", array()), isset($context["file_name"]) ? $context["file_name"] : $this->getContext($context, "file_name")); echo ")</span>\n "; } // line 207 echo " </li>\n\n "; // line 209 if ($context["index"] == twig_length_filter($this->env, isset($context["stack"]) ? $context["stack"] : $this->getContext($context, "stack")) - 1) { // line 210 echo " </ul>\n "; } // line 212 echo " "; } } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['index'], $context['call'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 213 echo " "; } else { // line 214 echo " "; if ($this->getAttribute(isset($context["log"]) ? $context["log"] : null, "context", array(), "any", true, true) && !twig_test_empty($this->getAttribute(isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "context", array()))) { // line 215 echo " <span class=\"metadata\">\n <strong>Context</strong>: "; // line 216 echo twig_escape_filter($this->env, twig_replace_filter(twig_jsonencode_filter($this->getAttribute(isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "context", array()), 64 | 256), array("{\"" => "{ \"", "\"}" => "\" }", "\":{" => "\": {", "\":\"" => "\": \"", "\",\"" => "\", \"")), "html", null, true); // line 218 echo "\n </span>\n "; } // line 221 echo " "; } $__internal_07f279c7df176c5a3e1446c7bd0bb83a9454032563e18984a59759be11176211->leave($__internal_07f279c7df176c5a3e1446c7bd0bb83a9454032563e18984a59759be11176211_prof); } catch (Exception $e) { ob_end_clean(); throw $e; } return '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); }
public function testTwigLast() { $twig = new Twig_Environment($this->getMock('Twig_LoaderInterface')); $this->assertEquals('c', twig_last($twig, 'abc')); $this->assertEquals(3, twig_last($twig, array(1, 2, 3))); $this->assertSame('', twig_last($twig, null)); $this->assertSame('', twig_last($twig, '')); }
public function getrender_log_message($__log_index__ = null, $__log__ = null, $__is_deprecation__ = false, ...$__varargs__) { $context = $this->env->mergeGlobals(array("log_index" => $__log_index__, "log" => $__log__, "is_deprecation" => $__is_deprecation__, "varargs" => $__varargs__)); $blocks = array(); ob_start(); try { $__internal_e3a48ea477df3582fb835c64ca25d824bd73bf29514a037d20987c514445ba1d = $this->env->getExtension("native_profiler"); $__internal_e3a48ea477df3582fb835c64ca25d824bd73bf29514a037d20987c514445ba1d->enter($__internal_e3a48ea477df3582fb835c64ca25d824bd73bf29514a037d20987c514445ba1d_prof = new Twig_Profiler_Profile($this->getTemplateName(), "macro", "render_log_message")); // line 154 echo " "; echo twig_escape_filter($this->env, twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "message", array()), "html", null, true); echo "\n\n "; // line 156 if (isset($context["is_deprecation"]) ? $context["is_deprecation"] : $this->getContext($context, "is_deprecation")) { // line 157 echo " "; $context["stack"] = twig_template_get_attributes($this, twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : null, "context", array(), "any", false, true), "stack", array(), "any", true, true) ? _twig_default_filter(twig_template_get_attributes($this, twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : null, "context", array(), "any", false, true), "stack", array()), array()) : array(); // line 158 echo " "; $context["id"] = "sf-call-stack-" . (isset($context["log_index"]) ? $context["log_index"] : $this->getContext($context, "log_index")); // line 159 echo "\n "; // line 160 if (twig_template_get_attributes($this, twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : null, "context", array(), "any", false, true), "errorCount", array(), "any", true, true)) { // line 161 echo " <span class=\"text-small text-bold\">("; echo twig_escape_filter($this->env, twig_template_get_attributes($this, twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "context", array()), "errorCount", array()), "html", null, true); echo " times)</span>\n "; } // line 163 echo "\n "; // line 164 if (isset($context["stack"]) ? $context["stack"] : $this->getContext($context, "stack")) { // line 165 echo " <button class=\"btn-link text-small sf-toggle\" data-toggle-selector=\"#"; echo twig_escape_filter($this->env, isset($context["id"]) ? $context["id"] : $this->getContext($context, "id"), "html", null, true); echo "\" data-toggle-alt-content=\"Hide stack trace\">Show stack trace</button>\n "; } // line 167 echo "\n "; // line 168 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable(isset($context["stack"]) ? $context["stack"] : $this->getContext($context, "stack")); foreach ($context['_seq'] as $context["index"] => $context["call"]) { if ($context["index"] > 1) { // line 169 echo " "; if ($context["index"] == 2) { // line 170 echo " <ul class=\"sf-call-stack\" id=\""; echo twig_escape_filter($this->env, isset($context["id"]) ? $context["id"] : $this->getContext($context, "id"), "html", null, true); echo "\" class=\"hidden\">\n "; } // line 172 echo "\n "; // line 173 if (twig_template_get_attributes($this, $context["call"], "class", array(), "any", true, true)) { // line 174 echo " "; $context["from"] = $this->env->getExtension('code')->abbrClass(twig_template_get_attributes($this, $context["call"], "class", array())) . "::" . $this->env->getExtension('code')->abbrMethod(twig_template_get_attributes($this, $context["call"], "function", array())); // line 175 echo " "; } elseif (twig_template_get_attributes($this, $context["call"], "function", array(), "any", true, true)) { // line 176 echo " "; $context["from"] = $this->env->getExtension('code')->abbrMethod(twig_template_get_attributes($this, $context["call"], "function", array())); // line 177 echo " "; } elseif (twig_template_get_attributes($this, $context["call"], "file", array(), "any", true, true)) { // line 178 echo " "; $context["from"] = twig_template_get_attributes($this, $context["call"], "file", array()); // line 179 echo " "; } else { // line 180 echo " "; $context["from"] = "-"; // line 181 echo " "; } // line 182 echo "\n "; // line 183 $context["file_name"] = twig_template_get_attributes($this, $context["call"], "file", array(), "any", true, true) && twig_template_get_attributes($this, $context["call"], "line", array(), "any", true, true) ? twig_last($this->env, twig_split_filter($this->env, twig_replace_filter(twig_template_get_attributes($this, $context["call"], "file", array()), array("\\" => "/")), "/")) : ""; // line 184 echo "\n <li>\n "; // line 186 echo isset($context["from"]) ? $context["from"] : $this->getContext($context, "from"); echo "\n "; // line 187 if (isset($context["file_name"]) ? $context["file_name"] : $this->getContext($context, "file_name")) { // line 188 echo " <span class=\"text-small\">(called from "; echo $this->env->getExtension('code')->formatFile(twig_template_get_attributes($this, $context["call"], "file", array()), twig_template_get_attributes($this, $context["call"], "line", array()), isset($context["file_name"]) ? $context["file_name"] : $this->getContext($context, "file_name")); echo ")</span>\n "; } // line 190 echo " </li>\n\n "; // line 192 if ($context["index"] == twig_length_filter($this->env, isset($context["stack"]) ? $context["stack"] : $this->getContext($context, "stack")) - 1) { // line 193 echo " </ul>\n "; } // line 195 echo " "; } } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['index'], $context['call'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 196 echo " "; } else { // line 197 echo " "; if (twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : null, "context", array(), "any", true, true) && !twig_test_empty(twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "context", array()))) { // line 198 echo " <span class=\"metadata\">\n <strong>Context</strong>: "; // line 199 echo twig_escape_filter($this->env, twig_replace_filter(twig_jsonencode_filter(twig_template_get_attributes($this, isset($context["log"]) ? $context["log"] : $this->getContext($context, "log"), "context", array()), 64 | 256), array("{\"" => "{ \"", "\"}" => "\" }", "\":{" => "\": {", "\":\"" => "\": \"", "\",\"" => "\", \"")), "html", null, true); // line 201 echo "\n </span>\n "; } // line 204 echo " "; } $__internal_e3a48ea477df3582fb835c64ca25d824bd73bf29514a037d20987c514445ba1d->leave($__internal_e3a48ea477df3582fb835c64ca25d824bd73bf29514a037d20987c514445ba1d_prof); } catch (Exception $e) { ob_end_clean(); throw $e; } return '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); }
public function testTwigLast() { $twig = new Apishka_Templater_Environment($this->createMock('Apishka_Templater_LoaderInterface')); $this->assertEquals('c', twig_last($twig, 'abc')); $this->assertEquals(3, twig_last($twig, array(1, 2, 3))); $this->assertSame('', twig_last($twig, null)); $this->assertSame('', twig_last($twig, '')); }
public function getform_tree_entry($__name__ = null, $__data__ = null, $__expanded__ = null, ...$__varargs__) { $context = $this->env->mergeGlobals(array("name" => $__name__, "data" => $__data__, "expanded" => $__expanded__, "varargs" => $__varargs__)); $blocks = array(); ob_start(); try { $__internal_b3e87ce6b6f9051b8a6b67333569755de0a3f0bacba73e3eef455932801fb665 = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $__internal_b3e87ce6b6f9051b8a6b67333569755de0a3f0bacba73e3eef455932801fb665->enter($__internal_b3e87ce6b6f9051b8a6b67333569755de0a3f0bacba73e3eef455932801fb665_prof = new Twig_Profiler_Profile($this->getTemplateName(), "macro", "form_tree_entry")); // line 427 echo " "; $context["tree"] = $this; // line 428 echo " <li>\n <div class=\"tree-inner\" data-tab-target-id=\""; // line 429 echo twig_escape_filter($this->env, $this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "id", array()), "html", null, true); echo "-details\">\n "; // line 430 if ($this->getAttribute($context["data"] ?? null, "errors", array(), "any", true, true) && twig_length_filter($this->env, $this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "errors", array())) > 0) { // line 431 echo " <div class=\"badge-error\">"; echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "errors", array())), "html", null, true); echo "</div>\n "; } // line 433 echo "\n "; // line 434 if (!twig_test_empty($this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "children", array()))) { // line 435 echo " <a class=\"toggle-button\" data-toggle-target-id=\""; echo twig_escape_filter($this->env, $this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "id", array()), "html", null, true); echo "-children\" href=\"#\"><span class=\"toggle-icon\"></span></a>\n "; } else { // line 437 echo " <div class=\"toggle-icon empty\"></div>\n "; } // line 439 echo "\n "; // line 440 echo twig_escape_filter($this->env, array_key_exists("name", $context) ? _twig_default_filter($context["name"] ?? $this->getContext($context, "name"), "(no name)") : "(no name)", "html", null, true); echo " "; if ($this->getAttribute($context["data"] ?? null, "type_class", array(), "any", true, true)) { echo "[<abbr title=\""; echo twig_escape_filter($this->env, $this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "type_class", array()), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, twig_last($this->env, twig_split_filter($this->env, $this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "type_class", array()), "\\")), "html", null, true); echo "</abbr>]"; } // line 441 echo " </div>\n\n "; // line 443 if (!twig_test_empty($this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "children", array()))) { // line 444 echo " <ul id=\""; echo twig_escape_filter($this->env, $this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "id", array()), "html", null, true); echo "-children\" "; if (!($context["expanded"] ?? $this->getContext($context, "expanded"))) { echo "class=\"hidden\""; } echo ">\n "; // line 445 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable($this->getAttribute($context["data"] ?? $this->getContext($context, "data"), "children", array())); foreach ($context['_seq'] as $context["childName"] => $context["childData"]) { // line 446 echo " "; echo $context["tree"]->getform_tree_entry($context["childName"], $context["childData"], false); echo "\n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['childName'], $context['childData'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 448 echo " </ul>\n "; } // line 450 echo " </li>\n"; $__internal_b3e87ce6b6f9051b8a6b67333569755de0a3f0bacba73e3eef455932801fb665->leave($__internal_b3e87ce6b6f9051b8a6b67333569755de0a3f0bacba73e3eef455932801fb665_prof); } catch (Exception $e) { ob_end_clean(); throw $e; } catch (Throwable $e) { ob_end_clean(); throw $e; } return '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); }
public function block_vich_file_widget($context, array $blocks = array()) { // line 344 ob_start(); // line 345 echo " <div class=\"easyadmin-vich-file\">\n "; // line 346 if (!twig_test_empty(array_key_exists("download_uri", $context) ? _twig_default_filter(isset($context["download_uri"]) ? $context["download_uri"] : null, "") : "")) { // line 347 echo " "; $context["download_title"] = twig_last($this->env, twig_split_filter($this->env, isset($context["download_uri"]) ? $context["download_uri"] : null, "/")) ? twig_last($this->env, twig_split_filter($this->env, isset($context["download_uri"]) ? $context["download_uri"] : null, "/")) : $this->env->getExtension('translator')->trans("download", array(), "VichUploaderBundle"); // line 348 echo " <a href=\""; echo twig_escape_filter($this->env, isset($context["download_uri"]) ? $context["download_uri"] : null, "html", null, true); echo "\">"; echo twig_escape_filter($this->env, isset($context["download_title"]) ? $context["download_title"] : null, "html", null, true); echo "</a>\n "; } // line 350 echo "\n <div class=\"row\">\n "; // line 352 if ($this->getAttribute(isset($context["form"]) ? $context["form"] : null, "delete", array(), "any", true, true)) { // line 353 echo " <div class=\"col-sm-3 col-md-2\">\n "; // line 354 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute(isset($context["form"]) ? $context["form"] : null, "delete", array()), 'row'); echo "\n </div>\n "; } // line 357 echo " <div class=\""; echo $this->getAttribute(isset($context["form"]) ? $context["form"] : null, "delete", array(), "any", true, true) ? "col-sm-9 col-md-10" : "col-sm-12"; echo "\">\n "; // line 358 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute(isset($context["form"]) ? $context["form"] : null, "file", array()), 'widget'); echo "\n </div>\n </div>\n </div>\n"; echo trim(preg_replace('/>\\s+</', '><', ob_get_clean())); }
public function getrender_log_message($__category__ = null, $__log_index__ = null, $__log__ = null, $__is_deprecation__ = false, ...$__varargs__) { $context = $this->env->mergeGlobals(array("category" => $__category__, "log_index" => $__log_index__, "log" => $__log__, "is_deprecation" => $__is_deprecation__, "varargs" => $__varargs__)); $blocks = array(); ob_start(); try { $__internal_c8b1f47d468c6cff1e9abcde7ed156556ae40151f061cd12ed6abb154ba7188d = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $__internal_c8b1f47d468c6cff1e9abcde7ed156556ae40151f061cd12ed6abb154ba7188d->enter($__internal_c8b1f47d468c6cff1e9abcde7ed156556ae40151f061cd12ed6abb154ba7188d_prof = new Twig_Profiler_Profile($this->getTemplateName(), "macro", "render_log_message")); // line 171 echo " "; echo twig_escape_filter($this->env, $this->getAttribute($context["log"] ?? $this->getContext($context, "log"), "message", array()), "html", null, true); echo "\n\n "; // line 173 if ($context["is_deprecation"] ?? $this->getContext($context, "is_deprecation")) { // line 174 echo " "; $context["stack"] = $this->getAttribute($this->getAttribute($context["log"] ?? null, "context", array(), "any", false, true), "stack", array(), "any", true, true) ? _twig_default_filter($this->getAttribute($this->getAttribute($context["log"] ?? null, "context", array(), "any", false, true), "stack", array()), array()) : array(); // line 175 echo " "; $context["stack_id"] = "sf-call-stack-" . ($context["category"] ?? $this->getContext($context, "category")) . "-" . ($context["log_index"] ?? $this->getContext($context, "log_index")); // line 176 echo "\n "; // line 177 if ($this->getAttribute($this->getAttribute($context["log"] ?? null, "context", array(), "any", false, true), "errorCount", array(), "any", true, true)) { // line 178 echo " <span class=\"text-small text-bold\">("; echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($context["log"] ?? $this->getContext($context, "log"), "context", array()), "errorCount", array()), "html", null, true); echo " times)</span>\n "; } // line 180 echo "\n "; // line 181 if ($context["stack"] ?? $this->getContext($context, "stack")) { // line 182 echo " <button class=\"btn-link text-small sf-toggle\" data-toggle-selector=\"#"; echo twig_escape_filter($this->env, $context["stack_id"] ?? $this->getContext($context, "stack_id"), "html", null, true); echo "\" data-toggle-alt-content=\"Hide stack trace\">Show stack trace</button>\n "; } // line 184 echo "\n "; // line 185 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable($context["stack"] ?? $this->getContext($context, "stack")); foreach ($context['_seq'] as $context["index"] => $context["call"]) { if ($context["index"] > 1) { // line 186 echo " "; if ($context["index"] == 2) { // line 187 echo " <ul class=\"sf-call-stack hidden\" id=\""; echo twig_escape_filter($this->env, $context["stack_id"] ?? $this->getContext($context, "stack_id"), "html", null, true); echo "\">\n "; } // line 189 echo "\n "; // line 190 if ($this->getAttribute($context["call"], "class", array(), "any", true, true)) { // line 191 echo " "; $context["from"] = $this->env->getExtension('Symfony\\Bridge\\Twig\\Extension\\CodeExtension')->abbrClass($this->getAttribute($context["call"], "class", array())) . "::" . $this->env->getExtension('Symfony\\Bridge\\Twig\\Extension\\CodeExtension')->abbrMethod($this->getAttribute($context["call"], "function", array())); // line 192 echo " "; } elseif ($this->getAttribute($context["call"], "function", array(), "any", true, true)) { // line 193 echo " "; $context["from"] = $this->env->getExtension('Symfony\\Bridge\\Twig\\Extension\\CodeExtension')->abbrMethod($this->getAttribute($context["call"], "function", array())); // line 194 echo " "; } elseif ($this->getAttribute($context["call"], "file", array(), "any", true, true)) { // line 195 echo " "; $context["from"] = $this->getAttribute($context["call"], "file", array()); // line 196 echo " "; } else { // line 197 echo " "; $context["from"] = "-"; // line 198 echo " "; } // line 199 echo "\n "; // line 200 $context["file_name"] = $this->getAttribute($context["call"], "file", array(), "any", true, true) && $this->getAttribute($context["call"], "line", array(), "any", true, true) ? twig_last($this->env, twig_split_filter($this->env, twig_replace_filter($this->getAttribute($context["call"], "file", array()), array("\\" => "/")), "/")) : ""; // line 201 echo "\n <li>\n "; // line 203 echo $context["from"] ?? $this->getContext($context, "from"); echo "\n "; // line 204 if ($context["file_name"] ?? $this->getContext($context, "file_name")) { // line 205 echo " <span class=\"text-small\">(called from "; echo $this->env->getExtension('Symfony\\Bridge\\Twig\\Extension\\CodeExtension')->formatFile($this->getAttribute($context["call"], "file", array()), $this->getAttribute($context["call"], "line", array()), $context["file_name"] ?? $this->getContext($context, "file_name")); echo ")</span>\n "; } // line 207 echo " </li>\n\n "; // line 209 if ($context["index"] == twig_length_filter($this->env, $context["stack"] ?? $this->getContext($context, "stack")) - 1) { // line 210 echo " </ul>\n "; } // line 212 echo " "; } } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['index'], $context['call'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 213 echo " "; } else { // line 214 echo " "; if ($this->getAttribute($context["log"] ?? null, "context", array(), "any", true, true) && !twig_test_empty($this->getAttribute($context["log"] ?? $this->getContext($context, "log"), "context", array()))) { // line 215 echo " "; $context["context_id"] = "context-" . ($context["category"] ?? $this->getContext($context, "category")) . "-" . ($context["log_index"] ?? $this->getContext($context, "log_index")); // line 216 echo " "; $context["context_dump"] = $this->env->getExtension('Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension')->dumpValue($this->getAttribute($context["log"] ?? $this->getContext($context, "log"), "context", array())); // line 217 echo "\n <div class=\"metadata\">\n <strong>Context</strong>:\n\n "; // line 221 if (twig_length_filter($this->env, $context["context_dump"] ?? $this->getContext($context, "context_dump")) > 120) { // line 222 echo " "; echo twig_escape_filter($this->env, twig_slice($this->env, $context["context_dump"] ?? $this->getContext($context, "context_dump"), 0, 120), "html", null, true); echo " ...\n\n <a class=\"btn-link text-small sf-toggle\" data-toggle-selector=\"#"; // line 224 echo twig_escape_filter($this->env, $context["context_id"] ?? $this->getContext($context, "context_id"), "html", null, true); echo "\" data-toggle-alt-content=\"Hide full context\">Show full context</a>\n\n <div id=\""; // line 226 echo twig_escape_filter($this->env, $context["context_id"] ?? $this->getContext($context, "context_id"), "html", null, true); echo "\" class=\"context\">\n <pre>"; // line 227 echo twig_escape_filter($this->env, $context["context_dump"] ?? $this->getContext($context, "context_dump"), "html", null, true); echo "</pre>\n </div>\n "; } else { // line 230 echo " "; echo twig_escape_filter($this->env, $context["context_dump"] ?? $this->getContext($context, "context_dump"), "html", null, true); echo "\n "; } // line 232 echo " </div>\n "; } // line 234 echo " "; } $__internal_c8b1f47d468c6cff1e9abcde7ed156556ae40151f061cd12ed6abb154ba7188d->leave($__internal_c8b1f47d468c6cff1e9abcde7ed156556ae40151f061cd12ed6abb154ba7188d_prof); } catch (Exception $e) { ob_end_clean(); throw $e; } catch (Throwable $e) { ob_end_clean(); throw $e; } return '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); }
public function getform_tree_entry($__name__ = null, $__data__ = null, $__expanded__ = null) { $context = $this->env->mergeGlobals(array("name" => $__name__, "data" => $__data__, "expanded" => $__expanded__, "varargs" => func_num_args() > 3 ? array_slice(func_get_args(), 3) : array())); $blocks = array(); ob_start(); try { $__internal_538c8443506485ae5524c332bb750bd6a186b921cedef8ea149ce9008baf9b7f = $this->env->getExtension("native_profiler"); $__internal_538c8443506485ae5524c332bb750bd6a186b921cedef8ea149ce9008baf9b7f->enter($__internal_538c8443506485ae5524c332bb750bd6a186b921cedef8ea149ce9008baf9b7f_prof = new Twig_Profiler_Profile($this->getTemplateName(), "macro", "form_tree_entry")); // line 427 echo " "; $context["tree"] = $this; // line 428 echo " <li>\n <div class=\"tree-inner\" data-tab-target-id=\""; // line 429 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "id", array()), "html", null, true); echo "-details\">\n "; // line 430 if (!twig_test_empty($this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "children", array()))) { // line 431 echo " <a class=\"toggle-button\" data-toggle-target-id=\""; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "id", array()), "html", null, true); echo "-children\" href=\"#\"><span class=\"toggle-icon\"></span></a>\n "; } else { // line 433 echo " <div class=\"toggle-icon empty\"></div>\n "; } // line 435 echo "\n "; // line 436 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 " "; 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)) { echo "[<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, twig_last($this->env, twig_split_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "type", array()), "\\")), "html", null, true); echo "</abbr>]"; } // line 437 echo "\n "; // line 438 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 439 echo " <div class=\"badge-error\">"; echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "errors", array())), "html", null, true); echo "</div>\n "; } // line 441 echo " </div>\n\n "; // line 443 if (!twig_test_empty($this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "children", array()))) { // line 444 echo " <ul id=\""; echo twig_escape_filter($this->env, $this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "id", array()), "html", null, true); echo "-children\" "; if (!(isset($context["expanded"]) ? $context["expanded"] : $this->getContext($context, "expanded"))) { echo "class=\"hidden\""; } echo ">\n "; // line 445 $context['_parent'] = $context; $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["data"]) ? $context["data"] : $this->getContext($context, "data"), "children", array())); foreach ($context['_seq'] as $context["childName"] => $context["childData"]) { // line 446 echo " "; echo $context["tree"]->getform_tree_entry($context["childName"], $context["childData"], false); echo "\n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['childName'], $context['childData'], $context['_parent'], $context['loop']); $context = array_intersect_key($context, $_parent) + $_parent; // line 448 echo " </ul>\n "; } // line 450 echo " </li>\n"; $__internal_538c8443506485ae5524c332bb750bd6a186b921cedef8ea149ce9008baf9b7f->leave($__internal_538c8443506485ae5524c332bb750bd6a186b921cedef8ea149ce9008baf9b7f_prof); } catch (Exception $e) { ob_end_clean(); throw $e; } return '' === ($tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset()); }
public function block_vich_file_widget($context, array $blocks = array()) { $__internal_4dc69c9c9d424baa7f027f4816c8ee2b7f20ac5dc828629353a0dd2bd8937c1c = $this->env->getExtension("native_profiler"); $__internal_4dc69c9c9d424baa7f027f4816c8ee2b7f20ac5dc828629353a0dd2bd8937c1c->enter($__internal_4dc69c9c9d424baa7f027f4816c8ee2b7f20ac5dc828629353a0dd2bd8937c1c_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "vich_file_widget")); // line 344 ob_start(); // line 345 echo " <div class=\"easyadmin-vich-file\">\n "; // line 346 if (!twig_test_empty(array_key_exists("download_uri", $context) ? _twig_default_filter(isset($context["download_uri"]) ? $context["download_uri"] : $this->getContext($context, "download_uri"), "") : "")) { // line 347 echo " "; $context["download_title"] = twig_last($this->env, twig_split_filter($this->env, isset($context["download_uri"]) ? $context["download_uri"] : $this->getContext($context, "download_uri"), "/")) ? twig_last($this->env, twig_split_filter($this->env, isset($context["download_uri"]) ? $context["download_uri"] : $this->getContext($context, "download_uri"), "/")) : $this->env->getExtension('translator')->trans("download", array(), "VichUploaderBundle"); // line 348 echo " <a href=\""; echo twig_escape_filter($this->env, isset($context["download_uri"]) ? $context["download_uri"] : $this->getContext($context, "download_uri"), "html", null, true); echo "\">"; echo twig_escape_filter($this->env, isset($context["download_title"]) ? $context["download_title"] : $this->getContext($context, "download_title"), "html", null, true); echo "</a>\n "; } // line 350 echo "\n <div class=\"row\">\n "; // line 352 if ($this->getAttribute(isset($context["form"]) ? $context["form"] : null, "delete", array(), "any", true, true)) { // line 353 echo " <div class=\"col-sm-3 col-md-2\">\n "; // line 354 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute(isset($context["form"]) ? $context["form"] : $this->getContext($context, "form"), "delete", array()), 'row'); echo "\n </div>\n "; } // line 357 echo " <div class=\""; echo $this->getAttribute(isset($context["form"]) ? $context["form"] : null, "delete", array(), "any", true, true) ? "col-sm-9 col-md-10" : "col-sm-12"; echo "\">\n "; // line 358 echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute(isset($context["form"]) ? $context["form"] : $this->getContext($context, "form"), "file", array()), 'widget'); echo "\n </div>\n </div>\n </div>\n"; echo trim(preg_replace('/>\\s+</', '><', ob_get_clean())); $__internal_4dc69c9c9d424baa7f027f4816c8ee2b7f20ac5dc828629353a0dd2bd8937c1c->leave($__internal_4dc69c9c9d424baa7f027f4816c8ee2b7f20ac5dc828629353a0dd2bd8937c1c_prof); }
public function testTwigLast() { $twig = new Twig_Environment(); $this->assertEquals('c', twig_last($twig, 'abc')); $this->assertEquals(3, twig_last($twig, [1, 2, 3])); $this->assertSame('', twig_last($twig, null)); $this->assertSame('', twig_last($twig, '')); }