本文整理汇总了PHP中twig_date_converter函数 的典型用法代码示例。如果您正苦于以下问题:PHP twig_date_converter函数的具体用法?PHP twig_date_converter怎么用?PHP twig_date_converter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了twig_date_converter函数 的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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\">×</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 © ";
// 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\">×</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ésignation</th>\n <th style=\"width: 35%\" class=\"text-right\">Quantité</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é 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é 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é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émentaires <small>(A récupérer en ½ journé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
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1218| 2022-08-30
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1130| 2022-08-17
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:938| 2022-11-06
wuyr/GoogleLibraryVersionQuerier: 一款Android Studio插件,帮助你快速添加依赖库和
阅读:599| 2022-08-15
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1334| 2022-08-18
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:485| 2022-08-16
An issue was discovered in yasm version 1.3.0. There is a use-after-free in expr
阅读:762| 2022-07-29
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:637| 2022-11-06
ammezie/support-ticket: A support ticket application in Laravel
阅读:583| 2022-08-13
shem8/MaterialLogin: Login view with material design
阅读:725| 2022-08-17
请发表评论