当前位置: 首页>>代码示例>>PHP>>正文


PHP twig_date_converter函数代码示例

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


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

示例1: twig_localized_date_filter

function twig_localized_date_filter(Twig_Environment $env, $date, $dateFormat = 'medium', $timeFormat = 'medium', $locale = null, $timezone = null, $format = null, $calendar = 'gregorian')
{
    $date = twig_date_converter($env, $date, $timezone);
    $formatValues = array('none' => IntlDateFormatter::NONE, 'short' => IntlDateFormatter::SHORT, 'medium' => IntlDateFormatter::MEDIUM, 'long' => IntlDateFormatter::LONG, 'full' => IntlDateFormatter::FULL);
    $formatter = IntlDateFormatter::create($locale, $formatValues[$dateFormat], $formatValues[$timeFormat], PHP_VERSION_ID >= 50500 ? $date->getTimezone() : $date->getTimezone()->getName(), 'gregorian' === $calendar ? IntlDateFormatter::GREGORIAN : IntlDateFormatter::TRADITIONAL, $format);
    return $formatter->format($date->getTimestamp());
}
开发者ID:kstefanini,项目名称:ep-plugin,代码行数:7,代码来源:Intl.php

示例2: __construct

 public function __construct()
 {
     parent::__construct('age', function (Twig_Environment $env, $date, $acc = 'y', $timezoneDate = null, $timezoneNow = null) {
         $now = time();
         if (!is_string($acc)) {
             throw new \Twig_Error_Runtime(sprintf('Accuracy must be string, got %s.', is_object($acc) ? get_class($acc) : gettype($acc) . (is_resource($acc) ? '' : '#' . $acc)));
         }
         $date = twig_date_converter($env, $date, $timezoneDate);
         $now = twig_date_converter($env, $now, $timezoneNow);
         $diff = $now->diff($date, false);
         switch (strtolower($acc)) {
             case 'y':
                 $v = $diff->y + $diff->m / 12 + ($diff->d + ($diff->h + ($diff->i + $diff->s / 60) / 60) / 24) / 365;
                 break;
                 // case 'm' is not supported by design
             // case 'm' is not supported by design
             case 'd':
                 $v = (int) $diff->format('%a') + ($diff->h + ($diff->i + $diff->s / 60) / 60) / 24;
                 break;
             case 'h':
                 $v = 24 * (int) $diff->format('%a') + $diff->h + ($diff->i + $diff->s / 60) / 60;
                 break;
             case 'i':
                 $v = 60 * 24 * (int) $diff->format('%a') + 60 * $diff->h + $diff->i + $diff->s / 60;
                 break;
             case 's':
                 return (int) $now->format('U') - (int) $date->format('U');
             default:
                 throw new \Twig_Error_Runtime(sprintf('Accuracy must be any of "y, d, h, i, s", got "%s".', $acc));
         }
         // (int) cast for HHVM =< 3.9.10
         // https://github.com/facebook/hhvm/pull/6134 / https://github.com/facebook/hhvm/issues/5537
         return 1 === (int) $diff->invert ? $v : -1 * $v;
     }, ['needs_environment' => true]);
 }
开发者ID:GeckoPackages,项目名称:GeckoTwig,代码行数:35,代码来源:AgeFilter.php

示例3: twig_localized_date_filter

function twig_localized_date_filter(Twig_Environment $env, $date, $dateFormat = 'medium', $timeFormat = 'medium', $locale = null, $timezone = null, $format = null)
{
    $date = twig_date_converter($env, $date, $timezone);
    $formatValues = array('none' => IntlDateFormatter::NONE, 'short' => IntlDateFormatter::SHORT, 'medium' => IntlDateFormatter::MEDIUM, 'long' => IntlDateFormatter::LONG, 'full' => IntlDateFormatter::FULL);
    $formatter = IntlDateFormatter::create($locale, $formatValues[$dateFormat], $formatValues[$timeFormat], $date->getTimezone()->getName(), IntlDateFormatter::GREGORIAN, $format);
    return $formatter->format($date->getTimestamp());
}
开发者ID:TuxCoffeeCorner,项目名称:tcc,代码行数:7,代码来源:Intl.php

示例4: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<html>\n  <head>\n    <meta charset=\"UTF-8\">\n    <title>AGeCo | Calendrier des absences</title>\n    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>\n  </head>\n  <body class=\"skin-blue\">\n    <div class=\"wrapper\">\n      \n      ";
     // line 10
     echo $this->env->getExtension('http_kernel')->renderFragment($this->env->getExtension('http_kernel')->controller("OCCalendrierBundle:Default:menu"));
     echo "\n      <!-- Right side column. Contains the navbar and content of the page -->\n      <div class=\"content-wrapper\">\n        <!-- Content Header (Page header) -->\n        <section class=\"content-header\">\n          <h1>\n            Calendrier des absences \n            <small>du service </small>\n          </h1>\n          <ol class=\"breadcrumb\">\n            <li><a href=\"#\"><i class=\"fa fa-dashboard\"></i> Home</a></li>\n            <li class=\"active\">Calendar</li>\n          </ol>\n        </section>\n\n        <!-- Main content -->\n        <section class=\"content\">\n          <div class=\"row\">\n            <div class=\"col-md-3\">\n              <div class=\"box box-solid\">\n                <div class=\"box-header with-border\">\n                  <h3 class=\"box-title\">Liste des agents du service ";
     // line 31
     echo twig_escape_filter($this->env, $this->getContext($context, "nomService"), "html", null, true);
     echo ": </h3>\n                    <div class=\"box-body\">\n                        ";
     // line 33
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getContext($context, "agentsService"));
     $context['loop'] = array('parent' => $context['_parent'], 'index0' => 0, 'index' => 1, 'first' => true);
     if (is_array($context['_seq']) || is_object($context['_seq']) && $context['_seq'] instanceof Countable) {
         $length = count($context['_seq']);
         $context['loop']['revindex0'] = $length - 1;
         $context['loop']['revindex'] = $length;
         $context['loop']['length'] = $length;
         $context['loop']['last'] = 1 === $length;
     }
     foreach ($context['_seq'] as $context["_key"] => $context["agent"]) {
         // line 34
         echo "                            ";
         echo twig_escape_filter($this->env, $this->getAttribute($context["loop"], "index", array()), "html", null, true);
         echo ". ";
         echo twig_escape_filter($this->env, $this->getAttribute($context["agent"], "nomCanonique", array()), "html", null, true);
         echo "<br>\n                        ";
         ++$context['loop']['index0'];
         ++$context['loop']['index'];
         $context['loop']['first'] = false;
         if (isset($context['loop']['length'])) {
             --$context['loop']['revindex0'];
             --$context['loop']['revindex'];
             $context['loop']['last'] = 0 === $context['loop']['revindex0'];
         }
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['agent'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 36
     echo "                    </div>\n                </div>\n              </div>\n            </div><!-- /.col -->\n            <div class=\"col-md-9\">\n              <div class=\"box box-primary\">\n                <div class=\"box-body no-padding\">\n                    <!-- THE CALENDAR -->\n                    <div id=\"calendar\"></div>\n                    <!-- Modal onclick -->\n                    <div id=\"fullCalModal\" class=\"modal fade\">\n                        <div class=\"modal-dialog\">\n                            <div class=\"modal-content\">\n                                <div class=\"modal-header\">\n                                    <button type=\"button\" class=\"close\" data-dismiss=\"modal\"><span aria-hidden=\"true\">&times;</span> <span class=\"sr-only\">close</span></button>\n                                    <h4 id=\"modalTitle\" class=\"modal-title\"></h4>\n                                </div>\n                                <div id=\"modalBody\" class=\"modal-body\"></div>\n                                <div class=\"modal-footer\">\n                                    <button class=\"btn btn-default\" data-dismiss=\"modal\">Fermer</button>\n                                    <a id=\"eventUrl\" target=\"_blank\" class=\"btn btn-primary\">Plus d'information</a>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div><!-- /.box-body -->\n              </div><!-- /. box -->\n            </div><!-- /.col -->\n          </div><!-- /.row -->\n        </section><!-- /.content -->\n      </div><!-- /.content-wrapper -->\n         <footer class=\"main-footer\">\n        <div class=\"pull-right hidden-xs\">\n          <b>Version</b> 2.0\n        </div>\n             <strong>Copyright &copy; ";
     // line 71
     echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_date_converter($this->env, "now"), "Y"), "html", null, true);
     echo " Cédric GUICHERD</a>.</strong> All rights reserved.\n      </footer>\n    </div><!-- ./wrapper -->\n";
     // line 74
     $this->displayBlock('stylesheet', $context, $blocks);
     // line 79
     $this->displayBlock('javascript', $context, $blocks);
     // line 194
     echo "  </body>\n</html>\n      ";
 }
开发者ID:guich25,项目名称:AppConge,代码行数:52,代码来源:9ccbf251b205e94c80d02230921c2a1ba8047e54690fc24cfc7cea08b0c4.php

示例5: diff

 /**
  * Filter for converting dates to a time ago string like Facebook and Twitter has.
  *
  * @param Twig_Environment $env  A Twig_Environment instance.
  * @param string|DateTime  $date A string or DateTime object to convert.
  * @param string|DateTime  $now  A string or DateTime object to compare with. If none given, the current time will be used.
  *
  * @return string The converted time.
  */
 public function diff(Twig_Environment $env, $date, $now = null)
 {
     // Convert both dates to DateTime instances.
     $date = twig_date_converter($env, $date);
     $now = twig_date_converter($env, $now);
     // Get the difference between the two DateTime objects.
     $diff = $date->diff($now);
     // Check for each interval if it appears in the $diff object.
     foreach (self::$units as $attribute => $unit) {
         $count = $diff->{$attribute};
         if (0 !== $count) {
             return $this->getPluralizedInterval($count, $diff->invert, $unit);
         }
     }
     return '';
 }
开发者ID:kstefanini,项目名称:ep-plugin,代码行数:25,代码来源:Date.php

示例6: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     if (!twig_test_empty(array_key_exists("nextRunTime", $context) ? _twig_default_filter(isset($context["nextRunTime"]) ? $context["nextRunTime"] : $this->getContext($context, "nextRunTime")) : "")) {
         // line 2
         echo "  ";
         if (twig_date_converter($this->env, $this->getAttribute(isset($context["nextRunTime"]) ? $context["nextRunTime"] : $this->getContext($context, "nextRunTime"), "getTimestamp", array(), "method")) <= twig_date_converter($this->env)) {
             // line 3
             echo "      ";
             echo twig_escape_filter($this->env, call_user_func_array($this->env->getFilter('translate')->getCallable(), array("UserCountry_UpdaterScheduledForNextRun")), "html", null, true);
             echo "\n  ";
         } else {
             // line 5
             echo "      ";
             echo call_user_func_array($this->env->getFilter('translate')->getCallable(), array("UserCountry_UpdaterWillRunNext", "<strong><em>" . $this->getAttribute(isset($context["nextRunTime"]) ? $context["nextRunTime"] : $this->getContext($context, "nextRunTime"), "toString", array(), "method") . "</em></strong>"));
             echo "\n  ";
         }
     } else {
         // line 8
         echo "  ";
         echo twig_escape_filter($this->env, call_user_func_array($this->env->getFilter('translate')->getCallable(), array("UserCountry_UpdaterIsNotScheduledToRun")), "html", null, true);
         echo "\n";
     }
 }
开发者ID:CaptainSharf,项目名称:SSAD_Project,代码行数:24,代码来源:c2f60123058a759a7c2a6117ecc69866bef46ba9c85bdcaa172117e8d9d5f5e0.php

示例7: twig_date_modify_filter

/**
 * Returns a new date object modified
 *
 * <pre>
 *   {{ post.published_at|modify("-1day")|date("m/d/Y") }}
 * </pre>
 *
 * @param Twig_Environment  $env      A Twig_Environment instance
 * @param DateTime|string   $date     A date
 * @param string            $modifier A modifier string
 *
 * @return DateTime A new date object
 */
function twig_date_modify_filter(Twig_Environment $env, $date, $modifier)
{
    if ($date instanceof DateTime) {
        $date = clone $date;
    } else {
        $date = twig_date_converter($env, $date);
    }
    $date->modify($modifier);
    return $date;
}
开发者ID:artz20,项目名称:Tv-shows-zone,代码行数:23,代码来源:Core.php

示例8: twig_date_format_filter

/**
 * Converts a date to the given format.
 *
 * <pre>
 *   {{ post.published_at|date("m/d/Y") }}
 * </pre>
 *
 * @param Twig_Environment             $env      A Twig_Environment instance
 * @param DateTime|DateInterval|string $date     A date
 * @param string                       $format   A format
 * @param DateTimeZone|string          $timezone A timezone
 *
 * @return string The formatter date
 */
function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $timezone = null)
{
    if (null === $format) {
        $formats = $env->getExtension('core')->getDateFormat();
        $format = $date instanceof DateInterval ? $formats[1] : $formats[0];
    }
    if ($date instanceof DateInterval || $date instanceof DateTime) {
        return $date->format($format);
    }
    return twig_date_converter($date, $timezone)->format($format);
}
开发者ID:SerdarSanri,项目名称:twig-bundle,代码行数:25,代码来源:Core.php

示例9: block_content


//.........这里部分代码省略.........
     echo " sort\">\n                <a href='/helpdesk/?";
     // line 162
     echo twig_escape_filter($this->env, isset($context["get_for_sorting_links"]) ? $context["get_for_sorting_links"] : null, "html", null, true);
     echo "ob=";
     echo twig_escape_filter($this->env, isset($context["col"]) ? $context["col"] : null, "html", null, true);
     echo twig_escape_filter($this->env, isset($context["order_desc"]) ? $context["order_desc"] : null, "html", null, true);
     echo "' title='Оценка'>\n                    <img src='/stat/img/helpdesk/rate_";
     // line 163
     echo twig_escape_filter($this->env, _twig_default_filter(strtr(isset($context["class"]) ? $context["class"] : null, array(" " => "_")), "0"), "html", null, true);
     echo "_min.png'>\n                </a>\n            </th>\n        </tr>\n    ";
     // line 167
     if (isset($context["tickets"]) ? $context["tickets"] : null) {
         // line 168
         echo "        ";
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["tickets"]) ? $context["tickets"] : null);
         foreach ($context['_seq'] as $context["id"] => $context["ticket"]) {
             // line 169
             echo "\n            ";
             // line 170
             list($context["unassigned"], $context["burning"]) = array("", "");
             // line 171
             echo "\n            ";
             // line 172
             if (!twig_join_filter($this->getAttribute(isset($context["ticket"]) ? $context["ticket"] : null, "performers"), ", ")) {
                 // line 173
                 echo "                ";
                 $context["unassigned"] = "unassigned";
                 // line 174
                 echo "            ";
             }
             // line 175
             echo "            ";
             if ($this->getAttribute(isset($context["ticket"]) ? $context["ticket"] : null, "deadline") > 0 && twig_date_converter($this->env, $this->getAttribute(isset($context["ticket"]) ? $context["ticket"] : null, "deadline")) <= twig_date_converter($this->env, "now") && twig_in_filter($this->getAttribute(isset($context["ticket"]) ? $context["ticket"] : null, "status"), array(0 => 1, 1 => 2, 2 => 3, 3 => 5, 4 => 7))) {
                 // line 176
                 echo "                ";
                 $context["burning"] = "burning";
                 // line 177
                 echo "            ";
             }
             // line 178
             echo "\n            <tr class='status_";
             // line 179
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ticket"]) ? $context["ticket"] : null, "status"), "html", null, true);
             echo " ";
             echo twig_escape_filter($this->env, isset($context["unassigned"]) ? $context["unassigned"] : null, "html", null, true);
             echo " ";
             echo twig_escape_filter($this->env, isset($context["burning"]) ? $context["burning"] : null, "html", null, true);
             echo "' data-id='";
             echo twig_escape_filter($this->env, isset($context["id"]) ? $context["id"] : null, "html", null, true);
             echo "'>\n                <td>\n                    <a id=\"ticket-status_";
             // line 181
             echo twig_escape_filter($this->env, isset($context["id"]) ? $context["id"] : null, "html", null, true);
             echo "\" class=\"popup_button noborder\">\n                        <img class='icon' src='/stat/img/helpdesk/status_";
             // line 182
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["ticket"]) ? $context["ticket"] : null, "status"), "html", null, true);
             echo ".png' title='";
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["statuses"]) ? $context["statuses"] : null, $this->getAttribute(isset($context["ticket"]) ? $context["ticket"] : null, "status"), array(), "array"), "name"), "html", null, true);
             echo "'>\n                    </a>\n                    <div id=\"popup_ticket-status_";
             // line 184
             echo twig_escape_filter($this->env, isset($context["id"]) ? $context["id"] : null, "html", null, true);
             echo "\" class=\"popup_menu\">\n                        <ul>\n                            ";
             // line 186
             $context['_parent'] = (array) $context;
             $context['_seq'] = twig_ensure_traversable(isset($context["statuses"]) ? $context["statuses"] : null);
             foreach ($context['_seq'] as $context["status_id"] => $context["status"]) {
开发者ID:progervlad,项目名称:utils,代码行数:67,代码来源:e5b78f5043033720246a259605de5ae007677eefa3caa09ceddda451d379.php

示例10: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"UTF-8\">\n    <title>AGeCo | Fiche ";
     // line 5
     echo twig_escape_filter($this->env, twig_title_string_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "prenom", array())), "html", null, true);
     echo " ";
     echo twig_escape_filter($this->env, twig_upper_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "nom", array())), "html", null, true);
     echo "</title>\n    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>\n    <style>\n        span.badge {\n            font-size: 13px;\n        }\n        .table-header-rotated td{\n\n          border-top: 1px solid #dddddd;\n          border-left: 1px solid #dddddd;\n          border-right: 1px solid #dddddd;\n          vertical-align: middle;\n          text-align: center;\n        }\n\n        .table-header-rotated th.rotate-45{\n          height: 80px;\n          position: relative;\n          vertical-align: bottom;\n          padding: 0;\n          font-size: 12px;\n          line-height: 0.8;\n        }\n\n        .table-header-rotated th.rotate-45 > div{\n          position: relative;\n          top: 0px;\n          left: 40px; /* 80 * tan(45) / 2 = 40 where 80 is the height on the cell and 45 is the transform angle*/\n          height: 100%;\n          -ms-transform:skew(-45deg,0deg);\n          -moz-transform:skew(-45deg,0deg);\n          -webkit-transform:skew(-45deg,0deg);\n          -o-transform:skew(-45deg,0deg);\n          transform:skew(-45deg,0deg);\n          overflow: hidden;\n          border-left: 1px solid #dddddd;\n        }\n\n        .table-header-rotated th.rotate-45 span {\n          -ms-transform:skew(45deg,0deg) rotate(315deg);\n          -moz-transform:skew(45deg,0deg) rotate(315deg);\n          -webkit-transform:skew(45deg,0deg) rotate(315deg);\n          -o-transform:skew(45deg,0deg) rotate(315deg);\n          transform:skew(45deg,0deg) rotate(315deg);\n          position: absolute;\n          bottom: 30px; /* 40 cos(45) = 28 with an additional 2px margin*/\n          left: -25px; /*Because it looked good, but there is probably a mathematical link here as well*/\n          // width: 100%;\n          width: 85px; /* 80 / cos(45) - 40 cos (45) = 85 where 80 is the height of the cell, 40 the width of the cell and 45 the transform angle*/\n          text-align: left;\n          // white-space: nowrap; /*whether to display in one line or not*/\n        }\n        .tp{\n            width: 80px;\n        }\n    </style>\n  </head>\n  <body class=\"skin-blue\">\n    <div class=\"wrapper\">\n      \n      ";
     // line 65
     echo $this->env->getExtension('http_kernel')->renderFragment($this->env->getExtension('http_kernel')->controller("OCAgentBundle:Default:menu"));
     echo "\n      <!-- Right side column. Contains the navbar and content of the page -->\n      <div class=\"content-wrapper\">\n        <!-- Content Header (Page header) -->\n        <section class=\"content-header \">\n          <h1>\n            Fiche Agent -  ";
     // line 71
     echo twig_escape_filter($this->env, twig_title_string_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "prenom", array())), "html", null, true);
     echo " ";
     echo twig_escape_filter($this->env, twig_upper_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "nom", array())), "html", null, true);
     echo "\n            <small>\n                ";
     // line 73
     if (twig_date_format_filter($this->env, "now", "Ymd") < twig_date_format_filter($this->env, twig_date_converter($this->env, twig_date_format_filter($this->env, "now", "Y") . "0831"), "Ymd")) {
         // line 74
         echo "                   01/09/";
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y") - 1, "html", null, true);
         echo " - 31/08/";
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y"), "html", null, true);
         echo "\n                ";
     } else {
         // line 76
         echo "                    01/09/";
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y"), "html", null, true);
         echo " - 31/08/";
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y") + 1, "html", null, true);
         echo "\n                ";
     }
     // line 78
     echo "            </small>\n            <div class=\"badge hidden-print\" ><a href=\"javascript:window.print()\"><i style=\"color:white\"class=\"fa fa-print\"></i></a></div>\n          </h1>\n          <ol class=\"breadcrumb hidden-print\">\n            <li><a href=\"#\"><i class=\"fa fa-dashboard\"></i> Home</a></li>\n            <li class=\"active\">Fiche agent</li>\n            <li class=\"active\">";
     // line 84
     echo twig_escape_filter($this->env, twig_title_string_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "prenom", array())), "html", null, true);
     echo " ";
     echo twig_escape_filter($this->env, twig_upper_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "nom", array())), "html", null, true);
     echo "</li>\n          </ol>\n        </section>\n        ";
     // line 87
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "app"), "session", array()), "flashbag", array()), "get", array(0 => "notice"), "method"));
     foreach ($context['_seq'] as $context["_key"] => $context["flashMessage"]) {
         if ($this->getAttribute($context["flashMessage"], "alert", array(), "any", true, true)) {
             // line 88
             echo "                <br>\n                <div class=\"alert alert-";
             // line 89
             echo twig_escape_filter($this->env, $this->getAttribute($context["flashMessage"], "alert", array()), "html", null, true);
             echo " alert-dismissible col-md-8\" role=\"alert\">\n                    <button type=\"button\" class=\"close\" data-dismiss=\"alert\">\n                        <span aria-hidden=\"true\">&times;</span><span class=\"sr-only\">Close</span>\n                    </button>\n                    <strong>";
             // line 93
             echo twig_escape_filter($this->env, $this->getAttribute($context["flashMessage"], "title", array()), "html", null, true);
             echo "</strong> ";
             echo twig_escape_filter($this->env, $this->getAttribute($context["flashMessage"], "message", array()), "html", null, true);
             echo "\n                </div>\n        ";
         }
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['flashMessage'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 96
     echo "        <!-- Main content -->\n        <section class=\"content\">\n          <div class=\"row\">\n            <div class=\"col-md-8\" style=\"min-width: 850px\">\n               \n                <div class=\"row\">\n                 <div class=\"col-xs-6\">\n               <div class=\"box\">\n                <div class=\"box-body no-padding\">\n                  <table class=\"table table-condensed table-hover \" >\n                    <tr>\n                      <th style=\"width: 10px\">#</th>\n                      <th>D&eacute;signation</th>\n                      <th style=\"width: 35%\" class=\"text-right\">Quantit&eacute;</th>\n                    </tr>\n                    <tr>\n                      <td>1.</td>\n                      <td>Horaire Hebdomadaire</td>\n                      <td><span class=\"badge bg-red pull-right\">";
     // line 114
     echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "VolHoraireHebdo", array()), "html", null, true);
     echo "</span></td>\n                    </tr>\n                    <tr>\n                      <td>2.</td>\n                      <td>Quotit&eacute; de travail</td>\n                      <td><span class=\"badge bg-yellow pull-right\">";
     // line 119
     echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "QuotiteTravail", array()), "html", null, true);
     echo " %</span></td>\n                    </tr>\n                    <tr>\n                      <td>3.</td>\n                      <td>Nombre de cong&eacute; annuel restant </td>\n                      <td><span class=\"badge bg-light-blue pull-right\">";
     // line 124
     echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "JoursRestant", array()), "html", null, true);
     echo " j</span></td>\n                    </tr>\n                    <tr>\n                      <td>4.</td>\n                      <td>Reliquat <small>(A prendre avant le 31 d&eacute;cembre \n                              ";
     // line 129
     if (twig_date_format_filter($this->env, "now", "d/m/Y") < twig_date_format_filter($this->env, "31-08-" . twig_date_format_filter($this->env, "now", "Y"), "d/m/Y")) {
         // line 130
         echo "                                    ";
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y"), "html", null, true);
         echo "\n                              ";
     } else {
         // line 132
         echo "                                    ";
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, "now", "Y") + 1, "html", null, true);
         echo "\n                              ";
     }
     // line 133
     echo ")</small></td>\n                      <td><span class=\"badge bg-green pull-right\">";
     // line 134
     echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "ReliquatRestant", array()), "html", null, true);
     echo " j</span></td>\n                    </tr>\n                    <tr>\n                      <td>5.</td>\n                      <td>Heures suppl&eacute;mentaires <small>(A r&eacute;cup&eacute;rer en &frac12 journ&eacute;es )</small></td>\n                      <td><span class=\"badge bg-orange pull-right\">";
     // line 139
     echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "heuresSup", array()), "html", null, true);
     echo "</span></td>\n                    </tr>\n                    <tr>\n                      <td>6.</td>\n                      <td>Heures de fractionnement </td>\n                      ";
     // line 144
     $context["hfrac"] = twig_split_filter($this->env, $this->getAttribute($this->getContext($context, "agent"), "heureFractionnement", array()), ".");
     // line 145
     echo "                      <td><span class=\"badge bg-aqua-gradient pull-right\">";
     if ($this->getAttribute($this->getContext($context, "hfrac", true), 0, array(), "any", true, true)) {
         echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "hfrac"), 0, array()), "html", null, true);
         echo "h";
     }
     if ($this->getAttribute($this->getContext($context, "hfrac", true), 1, array(), "any", true, true)) {
//.........这里部分代码省略.........
开发者ID:guich25,项目名称:AppConge,代码行数:101,代码来源:d17361de358666d726dd7ec697140c3de1aebf490a8e9c054f73fa23a567.php

示例11: twig_date_modify_filter

/**
 * Returns a new date object modified.
 *
 * <pre>
 *   {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
 * </pre>
 *
 * @param Apishka_Templater_Environment $env      A Apishka_Templater_Environment instance
 * @param DateTimeInterface|string      $date     A date
 * @param string                        $modifier A modifier string
 *
 * @return DateTimeInterface A new date object
 */
function twig_date_modify_filter(Apishka_Templater_Environment $env, $date, $modifier)
{
    $date = twig_date_converter($env, $date, false);
    return $date->modify($modifier);
}
开发者ID:apishka,项目名称:templater,代码行数:18,代码来源:Core.php

示例12: block_content

 public function block_content($context, array $blocks = array())
 {
     // line 8
     echo "    ";
     $this->env->loadTemplate("@AirBlog/Template/flashMsg.html.twig")->display($context);
     // line 9
     echo "    <article class=\"post\">\n        <header>\n            <h1>";
     // line 11
     echo twig_escape_filter($this->env, $this->getAttribute(isset($context["post"]) ? $context["post"] : null, "title", array()), "html", null, true);
     echo "</h1>\n\n            <div class=\"meta-data\">\n                <div class=\"author\">Autor <a href=\"#\">";
     // line 14
     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["post"]) ? $context["post"] : null, "author", array()), "username", array()), "html", null, true);
     echo "</a></div>\n                <div class=\"create-date\">";
     // line 15
     echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["post"]) ? $context["post"] : null, "publishedDate", array()), "d.m.Y, H:m"), "html", null, true);
     echo "</div>\n            </div>\n        </header>\n\n        <div class=\"thumbnail\">\n            <div class=\"meta-data\">\n                <div class=\"categories\">\n                    Kategoria:\n                    <a href=\"";
     // line 23
     echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("blog_category", array("slug" => $this->getAttribute($this->getAttribute(isset($context["post"]) ? $context["post"] : null, "category", array()), "slug", array()))), "html", null, true);
     echo "\">";
     echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["post"]) ? $context["post"] : null, "category", array()), "title", array()), "html", null, true);
     echo "</a>\n                </div>\n\n                <div class=\"tags\">\n                    Tagi:\n                    ";
     // line 28
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["post"]) ? $context["post"] : null, "tags", array()));
     foreach ($context['_seq'] as $context["_key"] => $context["tag"]) {
         // line 29
         echo "                    <a href=\"#\">";
         echo twig_escape_filter($this->env, $this->getAttribute($context["tag"], "title", array()), "html", null, true);
         echo "</a>\n                    ";
     }
     $_parent = $context['_parent'];
     unset($context['_seq'], $context['_iterated'], $context['_key'], $context['tag'], $context['_parent'], $context['loop']);
     $context = array_intersect_key($context, $_parent) + $_parent;
     // line 31
     echo "                </div>\n            </div>\n\n            <img src=\"";
     // line 34
     echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/airblog/images/default-thumbnail.jpg"), "html", null, true);
     echo "\" alt=\"\">\n        </div>\n\n        <p>";
     // line 37
     echo $this->getAttribute(isset($context["post"]) ? $context["post"] : null, "content", array());
     echo "</p>\n\n\n    </article> <!-- .post -->\n\n    <section class=\"post-comments\" id=\"post-comments\">\n        <header>\n            <h3>Komentarze (";
     // line 44
     echo twig_escape_filter($this->env, twig_length_filter($this->env, $this->getAttribute(isset($context["post"]) ? $context["post"] : null, "comments", array())), "html", null, true);
     echo ")</h3>\n        </header>\n        ";
     // line 47
     echo "        ";
     if ($this->getAttribute(isset($context["app"]) ? $context["app"] : null, "user", array())) {
         // line 48
         echo "            <div class=\"comment\">\n                <img class=\"thumbnail\" src=\"";
         // line 49
         echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl($this->getAttribute($this->getAttribute(isset($context["app"]) ? $context["app"] : null, "user", array()), "avatar", array())), "html", null, true);
         echo "\" alt=\"\">\n\n                <div class=\"body\">\n                    <div class=\"author\">";
         // line 52
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["app"]) ? $context["app"] : null, "user", array()), "username", array()), "html", null, true);
         echo "</div>\n                    <div class=\"create-date\">";
         // line 53
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_date_converter($this->env), "d/m/Y"), "html", null, true);
         echo "</div>\n\n                    <div class=\"clearfix\"></div>\n\n                    ";
         // line 65
         echo "\n                    ";
         // line 66
         $this->env->getExtension('form')->renderer->setTheme(isset($context["commentForm"]) ? $context["commentForm"] : null, array(0 => "AirBlogBundle:Form:form_template.html.twig"));
         // line 67
         echo "                    ";
         echo $this->env->getExtension('form')->renderer->renderBlock(isset($context["commentForm"]) ? $context["commentForm"] : null, 'form', array("action" => "#post-comments"));
         echo "\n                </div>\n            </div>\n        ";
     }
     // line 71
     echo "\n        ";
     // line 72
     $context['_parent'] = (array) $context;
     $context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["post"]) ? $context["post"] : null, "comments", array()));
     foreach ($context['_seq'] as $context["_key"] => $context["comment"]) {
         // line 73
         echo "            <div class=\"comment\">\n                <img class=\"thumbnail\" src=\"";
         // line 74
         echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl($this->getAttribute($this->getAttribute($context["comment"], "author", array()), "avatar", array())), "html", null, true);
         echo "\" alt=\"\">\n\n                <div class=\"body\">\n                    <div class=\"author\">\n                        ";
         // line 78
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($context["comment"], "author", array()), "username", array()), "html", null, true);
         echo "\n                        ";
         // line 79
         if ($this->env->getExtension('security')->isGranted("ROLE_ADMIN")) {
             // line 80
             echo "                        <div class=\"divider\"></div>\n                            ";
             // line 81
             $context["commentToken"] = $this->getAttribute(isset($context["csrfProvider"]) ? $context["csrfProvider"] : null, "generateCsrfToken", array(0 => sprintf(isset($context["tokenName"]) ? $context["tokenName"] : null, $this->getAttribute($context["comment"], "id", array()))), "method");
             // line 82
             echo "                            ";
             $context["deleteUrl"] = $this->env->getExtension('routing')->getPath("blog_deleteComment", array("commentId" => $this->getAttribute($context["comment"], "id", array()), "token" => isset($context["commentToken"]) ? $context["commentToken"] : null));
             // line 83
             echo "                        <a class=\"delete delete-comment\" href=\"";
             echo twig_escape_filter($this->env, isset($context["deleteUrl"]) ? $context["deleteUrl"] : null, "html", null, true);
             echo "\">Usuń</a>\n                        ";
         }
         // line 85
         echo "\n                    </div>\n                    <div class=\"create-date\">";
         // line 87
         echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute($context["comment"], "createDate", array()), "d/m/Y"), "html", null, true);
         echo "</div>\n\n                    <div class=\"clearfix\"></div>\n\n                    <p>";
//.........这里部分代码省略.........
开发者ID:dawidf,项目名称:air,代码行数:101,代码来源:87ce991120a338ce4f58bebf23b16954e2c53c300ad8fffcdc607d87b897.php

示例13: doDisplay


//.........这里部分代码省略.........
     // line 83
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "form"), "Commentaire", array()), 'errors');
     echo "\n                               ";
     // line 84
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "form"), "Commentaire", array()), 'widget', array("attr" => array("class" => "form-control")));
     echo "                                                                                               \n                               </div>\n\n                               <br>\n                               ";
     // line 88
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "form"), "Sauvegarder", array()), 'widget', array("attr" => array("class" => "form-control btn btn-primary")));
     echo "\n                         ";
     // line 89
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getContext($context, "form"), 'rest');
     echo "\n                         ";
     // line 90
     echo $this->env->getExtension('form')->renderer->renderBlock($this->getContext($context, "form"), 'form_end');
     echo "\n                       </div>\n                   </div>\n                 </div>\n                </div><!-- /#tabs-1 -->\n                <div id=\"hsf\">\n                                        <div class=\"box box-solid\">\n                <div class=\"box-header with-border\">\n                  <h3 class=\"box-title\">Faire une demande de r&eacute;cupération d'heure : </h3>\n                </div>\n                <div class=\"box-body\">\n                      ";
     // line 101
     echo $this->env->getExtension('form')->renderer->renderBlock($this->getContext($context, "formHSF"), 'form_start', array("attr" => array("class" => "form-horizontal")));
     echo "\n                      \n                      ";
     // line 103
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getContext($context, "formHSF"), 'errors');
     echo "\n                      \n                            ";
     // line 105
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "Agent", array()), 'label', array("label_attr" => array("class" => "control-label"), "label" => "Agent : "));
     echo "\n                            ";
     // line 106
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "Agent", array()), 'errors');
     echo "\n                            ";
     // line 107
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "Agent", array()), 'widget', array("attr" => array("class" => "form-control", "onchange" => "calcOpenDaysJS();recupAbsenceByAgent( \$(\"#oc_calendrierbundle_heuresupfrac_Agent\").val())")));
     echo "\n                            <br>\n                            ";
     // line 109
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "date", array()), 'label', array("label_attr" => array("class" => "control-label"), "label" => "Date"));
     echo "\n                            ";
     // line 110
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "date", array()), 'errors');
     echo "\n                            ";
     // line 111
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "date", array()), 'widget', array("attr" => array("class" => "bordure")));
     echo "\n                            <br>\n                            ";
     // line 113
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 'label', array("label_attr" => array("class" => "control-label"), "label" => "AM - PM"));
     echo "\n                            ";
     // line 114
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 'errors');
     echo "<br>\n                            <div class=\"bordure\" style=\"min-width:200px\">\n                            ";
     // line 116
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 0, array()), 'widget', array("attr" => array("onclick" => "renderEventMatin();calcHoursJS()")));
     echo "\n                            ";
     // line 117
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 0, array()), 'label', array("label" => "Matin"));
     echo "<br>\n                            ";
     // line 118
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 1, array()), 'widget', array("attr" => array("onclick" => "renderEventAprem();calcHoursJS()")));
     echo "\n                            ";
     // line 119
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 1, array()), 'label', array("label" => "Après midi"));
     echo "<br>\n                            ";
     // line 120
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 2, array()), 'widget', array("attr" => array("onclick" => "renderEventJournee();calcHoursJS()")));
     echo "\n                            ";
     // line 121
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getAttribute($this->getContext($context, "formHSF"), "AmPmJH", array()), 2, array()), 'label', array("label" => "Journee"));
     echo "\n                            </div>\n                            <br>\n                            \n                            ";
     // line 125
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "nbheure", array()), 'label', array("label_attr" => array("class" => "control-label "), "label" => "Nombre d'heures"));
     echo "\n                            ";
     // line 126
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "nbheure", array()), 'errors');
     echo "\n                            ";
     // line 127
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "nbheure", array()), 'widget', array("attr" => array("class" => "form-control ")));
     echo "\n                            <br>\n                            \n                            ";
     // line 130
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "Category", array()), 'label', array("label_attr" => array("class" => "control-label"), "label" => "Catégorie"));
     echo "\n                            ";
     // line 131
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "Category", array()), 'errors');
     echo "\n                            ";
     // line 132
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "Category", array()), 'widget', array("attr" => array("class" => "form-control selectFin")));
     echo "\n                            <br>\n                            \n                            <br>\n                            ";
     // line 136
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getAttribute($this->getContext($context, "formHSF"), "Sauvegarder", array()), 'widget', array("attr" => array("class" => "form-control btn btn-primary")));
     echo "\n                      ";
     // line 137
     echo $this->env->getExtension('form')->renderer->searchAndRenderBlock($this->getContext($context, "formHSF"), 'rest');
     echo "\n                      ";
     // line 138
     echo $this->env->getExtension('form')->renderer->renderBlock($this->getContext($context, "formHSF"), 'form_end');
     echo "\n                </div>\n              </div>\n                </div><!-- /#tabs-2 -->\n             </div>\n            </div><!-- /.col -->\n            <div class=\"col-md-9\">\n              <div class=\"box box-primary\">\n                <div class=\"box-body no-padding\">\n                    <!-- THE CALENDAR -->\n                    <div id=\"calendar\"></div>\n                    <!-- Modal onclick -->\n                    <div id=\"fullCalModal\" class=\"modal fade\">\n                        <div class=\"modal-dialog\">\n                            <div class=\"modal-content\">\n                                <div class=\"modal-header\">\n                                    <button type=\"button\" class=\"close\" data-dismiss=\"modal\"><span aria-hidden=\"true\">&times;</span> <span class=\"sr-only\">close</span></button>\n                                    <h4 id=\"modalTitle\" class=\"modal-title\"></h4>\n                                </div>\n                                <div id=\"modalBody\" class=\"modal-body\"></div>\n                                <div class=\"modal-footer\">\n                                    <button class=\"btn btn-default\" data-dismiss=\"modal\">Fermer</button>\n                                    <a id=\"eventUrl\" target=\"_blank\" class=\"btn btn-primary\">Plus d'information</a>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                </div><!-- /.box-body -->\n              </div><!-- /. box -->\n            </div><!-- /.col -->\n          </div><!-- /.row -->\n        </section><!-- /.content -->\n      </div><!-- /.content-wrapper -->\n         <footer class=\"main-footer\">\n        <div class=\"pull-right hidden-xs\">\n          <b>Version</b> 2.0\n        </div>\n             <strong>Copyright &copy; ";
     // line 175
     echo twig_escape_filter($this->env, twig_date_format_filter($this->env, twig_date_converter($this->env, "now"), "Y"), "html", null, true);
     echo " Cédric GUICHERD</a>.</strong> All rights reserved.\n      </footer>\n    </div><!-- ./wrapper -->\n";
     // line 178
     $this->displayBlock('stylesheet', $context, $blocks);
     // line 183
     $this->displayBlock('javascript', $context, $blocks);
     // line 478
     echo "  </body>\n</html>\n      ";
 }
开发者ID:guich25,项目名称:AppConge,代码行数:101,代码来源:85f409024cd5057de9efc35129eef93d6bee3c63e941ebc21dad64980062.php

示例14: doDisplay

 protected function doDisplay(array $context, array $blocks = array())
 {
     // line 1
     echo "<br>\n<br>\n";
     // line 3
     if (isset($context["listado_registros"]) ? $context["listado_registros"] : $this->getContext($context, "listado_registros")) {
         // line 4
         echo "\n    ";
         // line 5
         $this->env->loadTemplate("sisconeeAdministracionBundle::flashmessages.html.twig")->display($context);
         // line 6
         echo "\n    <div><span>Consumo Acumulado General del Servicio: </span><span id=\"acumulado_servicio\" class=\"label label-info\">";
         // line 7
         echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["consumoAcumulado"]) ? $context["consumoAcumulado"] : $this->getContext($context, "consumoAcumulado"), 0, array(), "array"), "cantidad", array(), "array"), "html", null, true);
         echo "</span></div>\n\n    ";
         // line 9
         if (isset($context["hasPlanHorarioPico"]) ? $context["hasPlanHorarioPico"] : $this->getContext($context, "hasPlanHorarioPico")) {
             // line 10
             echo "    <div><span>Consumo Acumulado para el Horario Pico del Servicio: </span><span id=\"acumulado_hp_servicio\" class=\"label label-info\">";
             echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(isset($context["consumoAcumulado"]) ? $context["consumoAcumulado"] : $this->getContext($context, "consumoAcumulado"), 0, array(), "array"), "cantidadHP", array(), "array"), "html", null, true);
             echo "</span></div>\n   ";
         }
         // line 12
         echo "\n<h1>Listado de los registros de plan y consumo diario</h1>\n<TABLE class=\"table table-striped table-bordered table-hover\">\n    <TR>\n        <TH>Fecha</TH>\n        <TH>Plan Diario</TH>\n        <TH>Consumo</TH>\n        ";
         // line 19
         if (isset($context["hasPlanHorarioPico"]) ? $context["hasPlanHorarioPico"] : $this->getContext($context, "hasPlanHorarioPico")) {
             // line 20
             echo "        <TH>Plan de Horario Pico</TH>\n        <TH>Consumo de Horario Pico</TH>\n        ";
         }
         // line 23
         echo "        <TH>Acciones</TH>\n    </TR>\n            ";
         // line 25
         $context['_parent'] = (array) $context;
         $context['_seq'] = twig_ensure_traversable(isset($context["listado_registros"]) ? $context["listado_registros"] : $this->getContext($context, "listado_registros"));
         foreach ($context['_seq'] as $context["_key"] => $context["r"]) {
             // line 26
             echo "                <TR>\n                <TD>";
             // line 27
             echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getFecha"), "d/m/Y"), "html", null, true);
             echo "</TD>\n                <TD>";
             // line 28
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getPlan"), "html", null, true);
             echo "</TD>\n                <TD ";
             // line 29
             if ($this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getConsumo") > $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getPlan")) {
                 echo " class=\"texto_alerta\" ";
             }
             echo " > ";
             echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getConsumo"), "html", null, true);
             echo " </TD>\n                ";
             // line 30
             if (isset($context["hasPlanHorarioPico"]) ? $context["hasPlanHorarioPico"] : $this->getContext($context, "hasPlanHorarioPico")) {
                 // line 31
                 echo "                <TD>";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getPlanHorariopico"), "html", null, true);
                 echo "</TD>\n                <TD ";
                 // line 32
                 if ($this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getConsumoHorariopico") > $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getPlanHorariopico")) {
                     echo " class=\"texto_alerta\" ";
                 }
                 echo " > ";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getConsumoHorariopico"), "html", null, true);
                 echo " </TD>\n                ";
             }
             // line 34
             echo "                <TD>";
             if (twig_date_converter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getFecha")) >= twig_date_converter($this->env, isset($context["diasPermitidos"]) ? $context["diasPermitidos"] : $this->getContext($context, "diasPermitidos")) && twig_date_converter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getFecha")) <= twig_date_converter($this->env)) {
                 echo "<a id=\"editar\" onclick=\" \$('#dialog').data('planDia',";
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getPlan"), "html", null, true);
                 echo ");\n                    \$('#dialog').data('planDiaHorarioPico',";
                 // line 35
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getPlanHorariopico"), "html", null, true);
                 echo ");\n                    \$('#dialog').data('consumoDia',";
                 // line 36
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getConsumo"), "html", null, true);
                 echo ");\n                    \$('#dialog').data('consumoDiaHorarioPico',";
                 // line 37
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getConsumoHorariopico"), "html", null, true);
                 echo ");\n                    \$('#dialog').data('idRegistro',";
                 // line 38
                 echo twig_escape_filter($this->env, $this->getAttribute(isset($context["r"]) ? $context["r"] : $this->getContext($context, "r"), "getId"), "html", null, true);
                 echo ");\n\n                    \$('#dialog').dialog('open'); \" ";
                 // line 40
                 echo "><span class=\"glyphicon glyphicon-pencil\"></span>Editar</a>";
             }
             // line 41
             echo "                </TD>\n                </TR>\n\n            ";
         }
         $_parent = $context['_parent'];
         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['r'], $context['_parent'], $context['loop']);
         $context = array_intersect_key($context, $_parent) + $_parent;
         // line 45
         echo "\n</TABLE>\n";
     } else {
         // line 48
         echo "    <p>No existe planificaci&oacute;n para los datos seleccionados</p>\n";
     }
     // line 50
     echo "\n\n\n\n\n\n\n\n\n\n";
 }
开发者ID:jorgemunoz8807,项目名称:sisconee,代码行数:100,代码来源:37560dac5e936eeeb0f67baa90421d6a5dc7b2bfa702b21f5b0e14307f63.php

示例15: twig_date_modify_filter

/**
 * Returns a new date object modified
 *
 * <pre>
 *   {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
 * </pre>
 *
 * @param Twig_Environment  $env      A Twig_Environment instance
 * @param DateTime|string   $date     A date
 * @param string            $modifier A modifier string
 *
 * @return DateTime A new date object
 */
function twig_date_modify_filter(Twig_Environment $env, $date, $modifier)
{
    $date = twig_date_converter($env, $date, false);
    $date->modify($modifier);
    return $date;
}
开发者ID:TiGR,项目名称:Twig,代码行数:19,代码来源:Core.php


注:本文中的twig_date_converter函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。