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

PHP twig_truncate_filter函数代码示例

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

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



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

示例1: lunrGenerator

 public function lunrGenerator(Twig_Environment $env, $posts)
 {
     $data = array('entries' => array());
     foreach ($posts as $post) {
         $meta = $post->meta();
         if (isset($meta['exclude_from_search'])) {
             continue;
         }
         $blocks = $post->blocks();
         if (isset($blocks['content'])) {
             $content = $this->compactFilter(strip_tags($blocks['content']));
         } else {
             $content = '';
         }
         if (isset($meta['description'])) {
             $description = $meta['description'];
         } else {
             $description = twig_truncate_filter($env, $content, 280);
         }
         $data['entries'][] = array('title' => $this->compactFilter(strip_tags($post->title())), 'url' => $post->url(), 'date' => date('Y-m-d H:i:s O', $post->date()), 'body' => htmlentities($content, ENT_COMPAT, "UTF-8", $double_encode = false), 'description' => htmlentities($description, ENT_COMPAT, "UTF-8", $double_encode = false));
     }
     $result = json_encode($data, JSON_PRETTY_PRINT, 5);
     if (false === $result) {
         $lastError = json_last_error();
         switch ($lastError) {
             case JSON_ERROR_NONE:
                 return 'No error has occurred';
             case JSON_ERROR_DEPTH:
                 return 'The maximum stack depth has been exceeded    ';
             case JSON_ERROR_STATE_MISMATCH:
                 return 'Invalid or malformed JSON';
             case JSON_ERROR_CTRL_CHAR:
                 return 'Control character error, possibly incorrectly encoded';
             case JSON_ERROR_SYNTAX:
                 return 'Syntax error';
             case JSON_ERROR_UTF8:
                 return 'Malformed UTF-8 characters, possibly incorrectly encoded';
             case JSON_ERROR_RECURSION:
                 return 'One or more recursive references in the value to be encoded';
             case JSON_ERROR_INF_OR_NAN:
                 return 'One or more NAN or INF values in the value to be encoded';
             case JSON_ERROR_UNSUPPORTED_TYPE:
                 return 'A value of a type that cannot be encoded was given';
             default:
                 return "Error #:" . $lastError;
         }
     }
     return $result;
 }
开发者ID:sitobcn82,项目名称:blog,代码行数:49,代码来源:Text.php


示例2: block_title

 public function block_title($context, array $blocks = array())
 {
     // line 15
     echo "    ";
     if (!(null === $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "id", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"))) {
         // line 16
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_edit", array("%name%" => twig_truncate_filter($this->env, $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "toString", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"), 15)), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     } else {
         // line 18
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_create", array(), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     }
 }
开发者ID:saberyounis,项目名称:Sonata-Project,代码行数:16,代码来源:b86cec180d94f969ba97b634a9eb00cde43cadfc80b406bdcffd2d1770c7.php


示例3: block_title

 public function block_title($context, array $blocks = array())
 {
     $__internal_a5f5151fd52c0671d5674c1689a3f354aee7b224771fe8da5cf553afcf11ebed = $this->env->getExtension("native_profiler");
     $__internal_a5f5151fd52c0671d5674c1689a3f354aee7b224771fe8da5cf553afcf11ebed->enter($__internal_a5f5151fd52c0671d5674c1689a3f354aee7b224771fe8da5cf553afcf11ebed_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "title"));
     // line 15
     echo "    ";
     if (!(null === $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "id", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"))) {
         // line 16
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_edit", array("%name%" => twig_truncate_filter($this->env, $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "toString", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"), 15)), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     } else {
         // line 18
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_create", array(), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     }
     $__internal_a5f5151fd52c0671d5674c1689a3f354aee7b224771fe8da5cf553afcf11ebed->leave($__internal_a5f5151fd52c0671d5674c1689a3f354aee7b224771fe8da5cf553afcf11ebed_prof);
 }
开发者ID:manudatta12,项目名称:POC,代码行数:19,代码来源:b52cbe05b559d4249aae2bc7a429079b1da760a60c6b89f04c711b4b60f6789b.php


示例4: block_title

 public function block_title($context, array $blocks = array())
 {
     $__internal_b37588a44e5ab0b1fcc8e294a865a4d7bb31c08552be46ce1a1a5af2c00fb0a8 = $this->env->getExtension("native_profiler");
     $__internal_b37588a44e5ab0b1fcc8e294a865a4d7bb31c08552be46ce1a1a5af2c00fb0a8->enter($__internal_b37588a44e5ab0b1fcc8e294a865a4d7bb31c08552be46ce1a1a5af2c00fb0a8_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "title"));
     // line 15
     echo "    ";
     if (!(null === $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "id", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"))) {
         // line 16
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_edit", array("%name%" => twig_truncate_filter($this->env, $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "toString", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"), 15)), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     } else {
         // line 18
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_create", array(), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     }
     $__internal_b37588a44e5ab0b1fcc8e294a865a4d7bb31c08552be46ce1a1a5af2c00fb0a8->leave($__internal_b37588a44e5ab0b1fcc8e294a865a4d7bb31c08552be46ce1a1a5af2c00fb0a8_prof);
 }
开发者ID:stuckiest,项目名称:SymfonyBlog,代码行数:19,代码来源:8ea7eb74cb8e1bfc218e9b2ec80b54f457e347327e52371e19b0102df71524f0.php


示例5: block_title

 public function block_title($context, array $blocks = array())
 {
     $__internal_446a216b6deb763d53156a548209c8844022eaa6d452341e4c097bb845b33ee0 = $this->env->getExtension("native_profiler");
     $__internal_446a216b6deb763d53156a548209c8844022eaa6d452341e4c097bb845b33ee0->enter($__internal_446a216b6deb763d53156a548209c8844022eaa6d452341e4c097bb845b33ee0_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "title"));
     // line 15
     echo "    ";
     if (!(null === $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "id", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"))) {
         // line 16
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_edit", array("%name%" => twig_truncate_filter($this->env, $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "toString", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"), 15)), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     } else {
         // line 18
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_create", array(), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     }
     $__internal_446a216b6deb763d53156a548209c8844022eaa6d452341e4c097bb845b33ee0->leave($__internal_446a216b6deb763d53156a548209c8844022eaa6d452341e4c097bb845b33ee0_prof);
 }
开发者ID:shine2lay,项目名称:jack,代码行数:19,代码来源:1e4555f0066dd1c7f7ff0289f69e258a0b56facaaa9fa1e1dedd9830c9a68cf5.php


示例6: block_title

 public function block_title($context, array $blocks = array())
 {
     $__internal_57d4756491c19f7538b3c1a09b66c14ba01f40c3219fe6d56cf1cb7070fbf3f0 = $this->env->getExtension("native_profiler");
     $__internal_57d4756491c19f7538b3c1a09b66c14ba01f40c3219fe6d56cf1cb7070fbf3f0->enter($__internal_57d4756491c19f7538b3c1a09b66c14ba01f40c3219fe6d56cf1cb7070fbf3f0_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "title"));
     // line 15
     echo "    ";
     if (!(null === $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "id", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"))) {
         // line 16
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_edit", array("%name%" => twig_truncate_filter($this->env, $this->getAttribute(isset($context["admin"]) ? $context["admin"] : $this->getContext($context, "admin"), "toString", array(0 => isset($context["object"]) ? $context["object"] : $this->getContext($context, "object")), "method"), 15)), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     } else {
         // line 18
         echo "        ";
         echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans("title_create", array(), "SonataAdminBundle"), "html", null, true);
         echo "\n    ";
     }
     $__internal_57d4756491c19f7538b3c1a09b66c14ba01f40c3219fe6d56cf1cb7070fbf3f0->leave($__internal_57d4756491c19f7538b3c1a09b66c14ba01f40c3219fe6d56cf1cb7070fbf3f0_prof);
 }
开发者ID:APanteleychuk,项目名称:symf_pro,代码行数:19,代码来源:a030f47041ecf9eb0588d60f5e082f3c20f0899613aa6e93c454e01ce478befa.php


示例7: block_field

 public function block_field($context, array $blocks = array())
 {
     $__internal_ff8d1d9eadf4a96e30d714c96fe87ba769eef963b1bb06c18166a5f2b7b60fe9 = $this->env->getExtension("native_profiler");
     $__internal_ff8d1d9eadf4a96e30d714c96fe87ba769eef963b1bb06c18166a5f2b7b60fe9->enter($__internal_ff8d1d9eadf4a96e30d714c96fe87ba769eef963b1bb06c18166a5f2b7b60fe9_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "field"));
     // line 4
     if (twig_test_empty(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"))) {
         // line 5
         echo " \n    ";
     } else {
         // line 7
         if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "truncate", array(), "any", true, true)) {
             // line 8
             $context["truncate"] = $this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : $this->getContext($context, "field_description"), "options", array()), "truncate", array());
             // line 9
             echo "            ";
             $context["length"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array()), 30) : 30;
             // line 10
             echo "            ";
             $context["preserve"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array()), false) : false;
             // line 11
             echo "            ";
             $context["separator"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array()), "...") : "...";
             // line 12
             echo "            ";
             echo twig_truncate_filter($this->env, strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value")), isset($context["length"]) ? $context["length"] : $this->getContext($context, "length"), isset($context["preserve"]) ? $context["preserve"] : $this->getContext($context, "preserve"), isset($context["separator"]) ? $context["separator"] : $this->getContext($context, "separator"));
         } else {
             // line 14
             if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "strip", array(), "any", true, true)) {
                 // line 15
                 $context["value"] = strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"));
             }
             // line 17
             echo isset($context["value"]) ? $context["value"] : $this->getContext($context, "value");
             echo "\n        ";
         }
         // line 19
         echo "    ";
     }
     $__internal_ff8d1d9eadf4a96e30d714c96fe87ba769eef963b1bb06c18166a5f2b7b60fe9->leave($__internal_ff8d1d9eadf4a96e30d714c96fe87ba769eef963b1bb06c18166a5f2b7b60fe9_prof);
 }
开发者ID:shine2lay,项目名称:jack,代码行数:40,代码来源:e33931e297128d0d99484f1091675dc7032bc7e42f689f0d7f3e87c5ea86807d.php


示例8: block_field

 public function block_field($context, array $blocks = array())
 {
     $__internal_29a8c1a6558cb46031c9953cf664b9d51d04917e738d3f01039696cf93dfd1b0 = $this->env->getExtension("native_profiler");
     $__internal_29a8c1a6558cb46031c9953cf664b9d51d04917e738d3f01039696cf93dfd1b0->enter($__internal_29a8c1a6558cb46031c9953cf664b9d51d04917e738d3f01039696cf93dfd1b0_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "field"));
     // line 4
     if (twig_test_empty(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"))) {
         // line 5
         echo " \n    ";
     } else {
         // line 7
         if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "truncate", array(), "any", true, true)) {
             // line 8
             $context["truncate"] = $this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : $this->getContext($context, "field_description"), "options", array()), "truncate", array());
             // line 9
             echo "            ";
             $context["length"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array()), 30) : 30;
             // line 10
             echo "            ";
             $context["preserve"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array()), false) : false;
             // line 11
             echo "            ";
             $context["separator"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array()), "...") : "...";
             // line 12
             echo "            ";
             echo twig_truncate_filter($this->env, strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value")), isset($context["length"]) ? $context["length"] : $this->getContext($context, "length"), isset($context["preserve"]) ? $context["preserve"] : $this->getContext($context, "preserve"), isset($context["separator"]) ? $context["separator"] : $this->getContext($context, "separator"));
         } else {
             // line 14
             if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "strip", array(), "any", true, true)) {
                 // line 15
                 $context["value"] = strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"));
             }
             // line 17
             echo isset($context["value"]) ? $context["value"] : $this->getContext($context, "value");
             echo "\n        ";
         }
         // line 19
         echo "    ";
     }
     $__internal_29a8c1a6558cb46031c9953cf664b9d51d04917e738d3f01039696cf93dfd1b0->leave($__internal_29a8c1a6558cb46031c9953cf664b9d51d04917e738d3f01039696cf93dfd1b0_prof);
 }
开发者ID:stuckiest,项目名称:SymfonyBlog,代码行数:40,代码来源:b63ae91ddecf06d073c7f09468475e6fc0628ca533893267c9b5179aa60b6a2e.php


示例9: block_field

 public function block_field($context, array $blocks = array())
 {
     $__internal_a0da2d8b14531892ccce64a3dfdc7e1daf791043cbceb3240a002f775a4bdc4f = $this->env->getExtension("native_profiler");
     $__internal_a0da2d8b14531892ccce64a3dfdc7e1daf791043cbceb3240a002f775a4bdc4f->enter($__internal_a0da2d8b14531892ccce64a3dfdc7e1daf791043cbceb3240a002f775a4bdc4f_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "field"));
     // line 4
     if (twig_test_empty(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"))) {
         // line 5
         echo " \n    ";
     } else {
         // line 7
         if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "truncate", array(), "any", true, true)) {
             // line 8
             $context["truncate"] = $this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : $this->getContext($context, "field_description"), "options", array()), "truncate", array());
             // line 9
             echo "            ";
             $context["length"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array()), 30) : 30;
             // line 10
             echo "            ";
             $context["preserve"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array()), false) : false;
             // line 11
             echo "            ";
             $context["separator"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array()), "...") : "...";
             // line 12
             echo "            ";
             echo twig_truncate_filter($this->env, strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value")), isset($context["length"]) ? $context["length"] : $this->getContext($context, "length"), isset($context["preserve"]) ? $context["preserve"] : $this->getContext($context, "preserve"), isset($context["separator"]) ? $context["separator"] : $this->getContext($context, "separator"));
         } else {
             // line 14
             if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "strip", array(), "any", true, true)) {
                 // line 15
                 $context["value"] = strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"));
             }
             // line 17
             echo isset($context["value"]) ? $context["value"] : $this->getContext($context, "value");
             echo "\n        ";
         }
         // line 19
         echo "    ";
     }
     $__internal_a0da2d8b14531892ccce64a3dfdc7e1daf791043cbceb3240a002f775a4bdc4f->leave($__internal_a0da2d8b14531892ccce64a3dfdc7e1daf791043cbceb3240a002f775a4bdc4f_prof);
 }
开发者ID:shine2lay,项目名称:jack,代码行数:40,代码来源:3f7b34711b4960b867ebd535461af9055c69c750b894b9fa7c6f864e298ac515.php


示例10: block_field

 public function block_field($context, array $blocks = array())
 {
     $__internal_718aad4dfae1801f3010c473adf08f3798f590c0630b82510d0bf7702325c336 = $this->env->getExtension("native_profiler");
     $__internal_718aad4dfae1801f3010c473adf08f3798f590c0630b82510d0bf7702325c336->enter($__internal_718aad4dfae1801f3010c473adf08f3798f590c0630b82510d0bf7702325c336_prof = new Twig_Profiler_Profile($this->getTemplateName(), "block", "field"));
     // line 4
     if (twig_test_empty(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"))) {
         // line 5
         echo " \n    ";
     } else {
         // line 7
         if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "truncate", array(), "any", true, true)) {
             // line 8
             $context["truncate"] = $this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : $this->getContext($context, "field_description"), "options", array()), "truncate", array());
             // line 9
             echo "            ";
             $context["length"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array()), 30) : 30;
             // line 10
             echo "            ";
             $context["preserve"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array()), false) : false;
             // line 11
             echo "            ";
             $context["separator"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array()), "...") : "...";
             // line 12
             echo "            ";
             echo twig_truncate_filter($this->env, strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value")), isset($context["length"]) ? $context["length"] : $this->getContext($context, "length"), isset($context["preserve"]) ? $context["preserve"] : $this->getContext($context, "preserve"), isset($context["separator"]) ? $context["separator"] : $this->getContext($context, "separator"));
         } else {
             // line 14
             if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "strip", array(), "any", true, true)) {
                 // line 15
                 $context["value"] = strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"));
             }
             // line 17
             echo isset($context["value"]) ? $context["value"] : $this->getContext($context, "value");
             echo "\n        ";
         }
         // line 19
         echo "    ";
     }
     $__internal_718aad4dfae1801f3010c473adf08f3798f590c0630b82510d0bf7702325c336->leave($__internal_718aad4dfae1801f3010c473adf08f3798f590c0630b82510d0bf7702325c336_prof);
 }
开发者ID:stuckiest,项目名称:SymfonyBlog,代码行数:40,代码来源:115b202d006f4c22af6a439dd3b935b80168d334f6d1155579f0bdb00cb43f9c.php


示例11: block_body

 public function block_body($context, array $blocks = array())
 {
     // line 11
     echo "    <div itemscope itemtype=\"http://schema.org/CreativeWork\">\n        <h1 id=\"title\" class=\"uppercase\" itemprop=\"headline\">Textes annexes</h1>\n        \n        <div id=\"contentMiddleFrame\" itemprop=\"text\"> \n            ";
     // line 15
     if (!twig_test_empty(isset($context["pagination"]) ? $context["pagination"] : null)) {
         // line 16
         echo "                ";
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["pagination"]) ? $context["pagination"] : null);
         foreach ($context['_seq'] as $context["_key"] => $context["annexText"]) {
             // line 17
             echo "                    <div itemscope itemtype=\"http://schema.org/Thing\">\n                        <p class=\"capital underline subtitle bold\" itemprop=\"name\">";
             // line 18
             echo twig_escape_filter($this->env, $this->getAttribute($context["annexText"], "title", array()), "html", null, true);
             echo "</p>\n                        <p itemprop=\"description\">";
             // line 19
             echo twig_truncate_filter($this->env, strip_tags($this->getAttribute($context["annexText"], "contents", array())), 370, true);
             echo "</p>\n                        <a class=\"colorUnderlineLink\" itemprop=\"url\" href=\"";
             // line 20
             echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("apa_story_annexText", array("numero" => $this->getAttribute($context["annexText"], "id", array()))), "html", null, true);
             echo "\">Lire la suite</a>\n                    </div>\n                ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['annexText'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 23
         echo "            ";
     } else {
         // line 24
         echo "                Il n'existe pas encore de textes annexes.\n            ";
     }
     // line 26
     echo "        </div>\n        <div id=\"pagination\" itemprop=\"pagination\">";
     // line 27
     echo $this->env->getExtension('knp_pagination')->render(isset($context["pagination"]) ? $context["pagination"] : null);
     echo "</div>\n    </div>\n";
 }
开发者ID:axelleP,项目名称:Oetherium,代码行数:38,代码来源:a3e82ab2a9de248675a11b631e261af589c8034680fb2c8cef5694dfbf7ea074.php


示例12: block_field

 public function block_field($context, array $blocks = array())
 {
     // line 4
     if (twig_test_empty(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"))) {
         // line 5
         echo "&nbsp;\n    ";
     } else {
         // line 7
         if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "truncate", array(), "any", true, true)) {
             // line 8
             $context["truncate"] = $this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : $this->getContext($context, "field_description"), "options", array()), "truncate", array());
             // line 9
             echo "            ";
             $context["length"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "length", array()), 30) : 30;
             // line 10
             echo "            ";
             $context["preserve"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "preserve", array()), false) : false;
             // line 11
             echo "            ";
             $context["separator"] = $this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array(), "any", true, true) ? _twig_default_filter($this->getAttribute(isset($context["truncate"]) ? $context["truncate"] : null, "separator", array()), "...") : "...";
             // line 12
             echo "            ";
             echo twig_truncate_filter($this->env, strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value")), isset($context["length"]) ? $context["length"] : $this->getContext($context, "length"), isset($context["preserve"]) ? $context["preserve"] : $this->getContext($context, "preserve"), isset($context["separator"]) ? $context["separator"] : $this->getContext($context, "separator"));
         } else {
             // line 14
             if ($this->getAttribute($this->getAttribute(isset($context["field_description"]) ? $context["field_description"] : null, "options", array(), "any", false, true), "strip", array(), "any", true, true)) {
                 // line 15
                 $context["value"] = strip_tags(isset($context["value"]) ? $context["value"] : $this->getContext($context, "value"));
             }
             // line 17
             echo isset($context["value"]) ? $context["value"] : $this->getContext($context, "value");
             echo "\n        ";
         }
         // line 19
         echo "    ";
     }
 }
开发者ID:axelleP,项目名称:Oetherium,代码行数:37,代码来源:79f9f089adb33f3a52a0dd3b270add3e756e2be4556ba7edf00645f862370a87.php


示例13: block_content


//.........这里部分代码省略.........
         if (isset($context["request"])) {
             $_request_ = $context["request"];
         } else {
             $_request_ = null;
         }
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($_client_, "order_get_list", array(0 => array("per_page" => 5, "page" => $this->getAttribute($_request_, "page"), "hide_addons" => 1)), "method"), "list"));
         $context['_iterated'] = false;
         foreach ($context['_seq'] as $context["i"] => $context["order"]) {
             // line 188
             echo "                <tr class=\"";
             if (isset($context["i"])) {
                 $_i_ = $context["i"];
             } else {
                 $_i_ = null;
             }
             echo twig_escape_filter($this->env, twig_cycle(array(0 => "odd", 1 => "even"), $_i_), "html", null, true);
             echo "\">\n                    <td><a href=\"";
             // line 189
             echo $this->env->getExtension('bb')->twig_bb_client_link_filter("order/service/manage");
             echo "/";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, $this->getAttribute($_order_, "id"), "html", null, true);
             echo "\">";
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo twig_escape_filter($this->env, twig_truncate_filter($this->env, $this->getAttribute($_order_, "title"), 30), "html", null, true);
             echo "</a></td>\n                    <td><span class=\"label ";
             // line 190
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             if ($this->getAttribute($_order_, "status") == "active") {
                 echo "label-success";
             } elseif ($this->getAttribute($_order_, "status") == "pending_setup") {
                 echo "label-warning";
             }
             echo "\">";
             if (isset($context["mf"])) {
                 $_mf_ = $context["mf"];
             } else {
                 $_mf_ = null;
             }
             if (isset($context["order"])) {
                 $_order_ = $context["order"];
             } else {
                 $_order_ = null;
             }
             echo $_mf_->getstatus_name($this->getAttribute($_order_, "status"));
             echo "</span></td>\n                </tr>\n                ";
             $context['_iterated'] = true;
         }
         if (!$context['_iterated']) {
             // line 193
             echo "                <tr>\n                    <td colspan=\"3\">";
             // line 194
             echo gettext("The list is empty");
开发者ID:NurulRizal,项目名称:BB,代码行数:67,代码来源:eeea4839802b7c79f8c66cd61367e368590d38c32cc2efbea091b4fad4ce.php


示例14: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\">\n        <title>";
     // line 5
     $this->displayBlock('title', $context, $blocks);
     echo "</title>\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n        <meta name=\"description\" content=\"Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.\">\n        <meta name=\"author\" content=\"Oueslati Rami\">\n\n        <!-- The styles -->\n        <link rel=\"stylesheet\" href=\"";
     // line 11
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/css/bootstrap.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 12
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/css/charisma-app.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 13
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/bower_components/chosen/chosen.min.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 14
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/bower_components/responsive-tables/responsive-tables.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 15
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/css/elfinder.theme.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 16
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/css/jquery.iphone.toggle.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 17
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/css/animate.min.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 18
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/css/datepicker.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n        <link rel=\"stylesheet\" href=\"";
     // line 19
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/css/flags.css"), "html", null, true);
     echo "\" type=\"text/css\" />\n\n        <!-- The fav icon -->\n        <link rel=\"shortcut icon\" href=\"";
     // line 22
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("backoffice/img/img/favicon.ico"), "html", null, true);
     echo "\">\n    </head>\n\n    <body>\n        <!-- topbar starts -->\n        <div class=\"navbar navbar-default\" role=\"navigation\">\n            <div class=\"navbar-inner\">\n                <button type=\"button\" class=\"navbar-toggle pull-left animated flip\">\n                    <span class=\"sr-only\">Toggle navigation</span>\n                   

鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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