本文整理汇总了PHP中Helper::formatDate方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::formatDate方法的具体用法?PHP Helper::formatDate怎么用?PHP Helper::formatDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Helper
的用法示例。
在下文中一共展示了Helper::formatDate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<table id="reportsTbl<?php
echo $issue->issue_id;
?>
" class="table table-condensed table-bordered table-hover reports-tbl" >
<tbody>
<?php
foreach ($reports as $r) {
?>
<tr id="reportRow<?php
echo $r->report_id;
?>
" class="report" >
<td style="width:25px; text-align:center;" ><i class="icon-file" ></i></td>
<td class="datetime" >
<?php
echo Helper::formatDate($r->user_crash_date, $cfg->getDateFormat(), $r->isNew());
?>
</td>
<td class="android-version" ><?php
echo $r->android_version;
?>
</td>
<td class="phone-model" ><?php
echo $r->getApplicationVersion();
?>
</td>
<td class="user-comment" ><i class="muted" ><?php
echo empty($r->user_comment) ? 'No user comment' : $r->user_comment;
?>
</i></td>
<td style="text-align:center; width:35px; text-decoration:none;" >
示例2: foreach
<th style="width:35px; text-align:center;" ><?php
echo Helper::getBadge(true);
?>
</th>
</tr>
</thead>
<tbody>
<?php
foreach ($arr as $v) {
?>
<tr style="cursor:pointer;" onclick="showIssueDetails(<?php
echo $v[ISSUE_ID];
?>
)" >
<td class="datetime" ><?php
echo Helper::formatDate($v[ISSUE_DATETIME], $cfg->getDateFormat(), false);
?>
</td>
<td class="priority" ><?php
$p = new IssuePriority($v[ISSUE_PRIORITY]);
echo $p->getLabel(false);
?>
</td>
<td class="application" ><?php
echo $v[APP_NAME];
?>
</td>
<td class="cause" >
<?php
$cause = explode(':', Helper::shrinkString($v[ISSUE_CAUSE], 160));
$causelen = strlen($v[ISSUE_CAUSE]);
示例3: getFormattedAppStartDate
public function getFormattedAppStartDate()
{
return Helper::formatDate($this->user_app_start_date, CfgHelper::getInstance()->getDateFormat());
}
示例4: foreach
foreach ($children as $child) {
$name = Dropbox\Path::getName($child['path']);
if (!$child['is_dir']) {
?>
<dl>
<dt class="<?php
echo preg_replace('/[^A-Za-z0-9_\\-]/', '-', $child['mime_type']);
?>
" title="<?php
echo Helper::formatMimeType($child['mime_type']);
?>
"><a href="javascript:;" title="<?php
echo CHtml::encode($name);
?>
" dropboxpath="<?php
echo base64_encode($child['path']);
?>
"><?php
echo CHtml::encode($name);
?>
</a></dt>
<dd class="publication_date"><?php
echo Yii::t('blocs', 'Publié le') . " " . Helper::formatDate($child['client_mtime'], "reg");
?>
</dd>
</dl>
<?php
}
}
}
Yii::app()->clientScript->registerScript('dropboxLinks', "\n\t\$('[dropboxpath]').click(function() {\n\t\tvar url = '" . $this->createUrl('/site/getdropboxlink', array('path' => '000')) . "';\n\t\turl = url.replace('000', \$(this).attr('dropboxpath'));\n\t\t\$.post(url, function(data) {\n\t\t\tif (typeof data[0] == 'string') {\n\t\t\t\twindow.location = data[0];\n\t\t\t}\n\t\t}, 'json');\n\t});\n", CClientScript::POS_READY);
示例5: mb_strtolower
<header>
<h3 class="page-title"><?php
echo $contestTitle;
?>
</h3>
</header>
<?php
if ($contest->end_date != "") {
?>
<p class="well well-sm"><?php
echo Yii::t('contestModule.common', 'Ce');
echo mb_strtolower(Yii::app()->cms->currentAlias->title, 'UTF-8');
echo Yii::t('contestModule.common', 'a pris fin le');
echo Helper::formatDate($contest->end_date, "reg");
echo Yii::t('contestModule.common', 'à');
echo substr($contest->end_date, 11, 5);
?>
.</p>
<?php
} else {
?>
<p class="well well-sm"><?php
echo Yii::t('contestModule.common', 'Ce');
echo mb_strtolower(Yii::app()->cms->currentAlias->title, 'UTF-8');
echo Yii::t('contestModule.common', 'est terminé');
?>
.</p>
<?php
}
示例6: substr
<header>
<h1><a href="<?php
echo $detailUrl;
?>
"><?php
echo $eventTitle;
?>
</a></h1>
<p class="article-date">
<?php
$start_date = substr($event->date_start, 0, 10);
$end_date = substr($event->date_end, 0, 10);
if ($start_date == $end_date) {
echo Yii::t('eventModule.common', 'Le') . " " . Helper::formatDate($start_date, "reg");
} else {
echo Yii::t('eventModule.common', 'Du') . " " . Helper::formatDate($start_date, "reg") . " " . Yii::t('eventModule.common', 'au') . " " . Helper::formatDate($end_date, "reg");
}
?>
</p>
</header>
<div class="row">
<?php
if ($event->image != "") {
?>
<div class="article-image col-sm-4 col-sm-push-8">
<a href="<?php
echo $detailUrl;
?>
示例7: array
<p class="article-image"><img src="<?php
echo Yii::app()->request->baseUrl . "/" . $newsEntry->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($newsEntry->image, 'm'));
?>
" alt="<?php
echo CHtml::encode($newsEntry->title);
?>
" class="img-responsive"></p>
<?php
}
?>
<p class="article-date"><?php
echo Yii::t('newsModule.common', 'Publiée le');
?>
<?php
echo Helper::formatDate($newsEntry->date, "reg");
?>
</p>
<h1 class="article-title"><a href="<?php
echo $this->controller->createUrl('/news/default/detail', array('n' => $newsEntry->title_url));
?>
" title="<?php
echo Yii::t('newsModule.common', 'Lire cette nouvelle');
?>
"><?php
echo CHtml::encode($newsEntry->title);
?>
</a></h1>
</header>
<div class="article-abstract">
示例8: substr
?>
<section class="section-bloc" id="formulaire">
<h4><?php
echo Yii::t('contestModule.common', 'Formulaire de participation');
?>
</h4>
<?php
if ($contest->start_date > $currentDate) {
// Contest is not started.
?>
<p class="alert alert-info"><?php
echo Yii::t('contestModule.common', 'Le formulaire de participation sera accessible à partir du') . Helper::formatDate($contest->start_date, "reg") . Yii::t('contestModule.common', 'à') . substr($contest->start_date, 11, 5);
?>
.</p>
<?php
} elseif ($contest->max_participation !== null && ContestEntry::model()->countByAttributes(array('contest_id' => $contest->id)) >= $contest->max_participation) {
// Max. participation has been reached.
?>
<p class="alert alert-danger"><?php
echo Yii::t('contestModule.common', 'Le nombre maximum de participations a été atteint pour ce concours');
?>
.</p>
<?php
} elseif (!$contest->multiple_entries && ContestEntry::model()->countByAttributes(array('contest_id' => $contest->id, 'ip' => $_SERVER['REMOTE_ADDR'])) > 0) {
示例9: foreach
?>
<p>Vous n'avez aucun message.</p>
<?php
} else {
?>
<?php
foreach ($messages as $message) {
?>
<div class="alert alert-info alert-dismissable">
<div class="alert-header clearfix">
<p class="message-date"><?php
echo Helper::formatDate($message->message->datetime, "reg");
?>
</p>
<?php
if ($message->seen == 0) {
?>
<span class="message-new-tag icon-star" title="Nouveau message"></span>
<?php
}
?>
</div>
<button id="dismiss-button-<?php
echo $message->message_id;
?>
" type="button" class="close" data-dismiss="alert" aria-hidden="true" title="Ne plus voir ce message">×</button>
<div class="section-bloc"><?php
示例10:
?>
" style="color:#00B1B8; text-decoration:none;"><span style="color:#00B1B8;"><?php
echo $item->get_title();
?>
</span></a>
</div>
</td>
</tr>
<tr><td width="100%" height="8"></td></tr>
<tr>
<td>
<div class="email-content-article-date" style="font-family: Arial, Helvetica, sans-serif; font-size:0.8em; color:#666666;"><?php
echo Yii::t('newsletterModule.common', 'Posté le');
?>
<?php
echo Helper::formatDate($item->get_date('Y-m-d H:i:s'), 'reg');
?>
</div>
</td>
</tr>
<tr><td width="100%" height="20"></td></tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
<tbody>
<tr>
<?php
if ($articleImage != "") {
/////////// Article Image.
?>
示例11:
</a></h1>
<p class="article-date">
<?php
if ($eventEntry->date_start == $eventEntry->date_end) {
echo Yii::t('eventModule.common', 'Le');
?>
<?php
echo Helper::formatDate($eventEntry->date_start, "reg");
} else {
echo Yii::t('eventModule.common', 'Du');
?>
<?php
echo Helper::formatDate($eventEntry->date_start, "reg") . " " . Yii::t('eventModule.common', 'au');
?>
<?php
echo Helper::formatDate($eventEntry->date_end, "reg");
}
?>
</p>
</header>
<div class="row clearfix">
<?php
if ($eventEntry->image != "") {
?>
<div class="article-image col-sm-3">
<p class="article-image"><img src="<?php
echo Yii::app()->request->baseUrl . "/" . $eventEntry->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($eventEntry->image, 'm'));
?>
" alt="<?php
echo CHtml::encode($eventEntry->title);
示例12: actionRss
public function actionRss()
{
// disabling web log
foreach (Yii::app()->log->routes as $route) {
if ($route instanceof CWebLogRoute) {
$route->enabled = false;
}
}
Yii::import('ext.feed.*');
$feed = new EFeed();
$feed->title = Yii::app()->name . ' | ' . Yii::t('jobModule.common', 'Offres demplois');
$feed->description = Yii::app()->name . ' | ' . Yii::t('jobModule.common', 'Offres demplois');
$feed->addChannelTag('language', Yii::app()->language);
$feed->addChannelTag('pubDate', date(DATE_RSS, time()));
$feed->addChannelTag('link', $this->createAbsoluteUrl('index'));
if ($jobs = Job::model()->findAll(array('order' => 'publication_date DESC', 'limit' => 25, 'condition' => "publication_date <= '" . date('Y-m-d H:i:s') . "' AND active = 1"))) {
foreach ($jobs as $job) {
$item = $feed->createNewItem();
$item->title = $job->title;
$item->link = $this->createAbsoluteUrl('/job/default/detail', array('t' => $job->title_url));
$item->date = $job->publication_date;
$type = '';
switch ($job->type) {
case '1':
$type = "Permanent";
break;
case '2':
$type = "Temps partiel";
break;
case '3':
$type = "Saisonnier";
break;
}
$item->description = "\n\t\t\t\t\t<p>\n\t\t\t\t\t\tType de l’emploi : " . $type . "<br/>\n\t\t\t\t\t\tDate de début : " . ((isset($job->start_date) and $job->start_date != '0000-00-00') ? Helper::formatDate($job->start_date, "reg") : Yii::t('jobModule.common', 'Indéterminée')) . "<br/>\n\t\t\t\t\t\tDate et heure limite pour postuler : " . (isset($job->postulation_end_date) ? substr(Helper::formatDate($job->postulation_end_date, "reg+time"), 0, -3) : Yii::t('jobModule.common', 'Indéterminée')) . "\n\t\t\t\t\t</p>\t\t\n\t\t\t\t" . strip_tags($job->description);
$feed->addItem($item);
}
}
$feed->generateFeed();
Yii::app()->end();
}
示例13:
?>
" title="<?php
echo Helper::formatMimeType($document->mime_type);
?>
"><a href="<?php
echo Yii::app()->baseUrl . '/files/_user/bloc_document/' . Helper::encodeFileName($document->file);
?>
" title="<?php
echo CHtml::encode($document->title);
?>
"><?php
echo CHtml::encode($document->title);
?>
</a></dt>
<dd class="publication_date"><?php
echo Yii::t('blocs', 'Publié le') . " " . Helper::formatDate($document->datetime, "reg");
?>
</dd>
<?php
if ($document->description != "") {
?>
<dd class="description"><?php
echo CHtml::encode($document->description);
?>
</dd>
<?php
}
?>
</dl>
<?php
示例14: array
$id = $value['id'];
$ckb = '<input type="checkbox" name="cid[]" value="' . $id . '" />';
$name = $value['name'];
$picturePath = UPLOAD_PATH . 'category' . DS . '60x90-' . $value['picture'];
if (file_exists($picturePath) == true) {
$picture = '<img src="' . UPLOAD_URL . 'category' . DS . '60x90-' . $value['picture'] . '" />';
} else {
$picture = '<img src="' . UPLOAD_URL . 'category' . DS . '60x90-default.jpg" />';
}
$row = $i % 2 == 0 ? 'row0' : 'row1';
// index.php?module=admin&controller=category&action=ajaxStatus&id=2&status=0
$status = Helper::cmsStatus($value['status'], URL::createLink('admin', 'category', 'ajaxStatus', array('id' => $id, 'status' => $value['status'])), $id);
$ordering = '<input type="text" name="order[' . $id . ']" size="5" value="' . $value['ordering'] . '" class="text-area-order">';
$created = Helper::formatDate('d-m-Y', $value['created']);
$created_by = $value['created_by'];
$modified = Helper::formatDate('d-m-Y', $value['modified']);
$modified_by = $value['modified_by'];
$linkEdit = URL::createLink('admin', 'category', 'form', array('id' => $id));
echo '<tr class="' . $row . '">
<td class="center">' . $ckb . '</td>
<td><a href="' . $linkEdit . '">' . $name . '</a></td>
<td class="center">' . $picture . '</td>
<td class="center">' . $status . '</td>
<td class="center">' . $ordering . '</td>
<td class="center">' . $created . '</td>
<td class="center">' . $created_by . '</td>
<td class="center">' . $modified . '</td>
<td class="center">' . $modified_by . '</td>
<td class="center">' . $id . '</td>
</tr>';
$i++;
示例15: isset
<?php
$jobTitle = CHtml::encode($job->title);
$this->breadcrumbs = Helper::breadcrumbsFromAlias(true);
$this->breadcrumbs[] = $job->title;
$this->pageTitle = Helper::titleFromBreadcrumbs();
$jobPublicationDate = Helper::formatDate($job->publication_date, "reg");
$jobStartDate = (isset($job->start_date) and $job->start_date != '0000-00-00') ? Helper::formatDate($job->start_date, "reg") : Yii::t('jobModule.common', 'Indéterminée');
$jobPostulationEndDate = isset($job->postulation_end_date) ? substr(Helper::formatDate($job->postulation_end_date, "reg+time"), 0, -3) : Yii::t('jobModule.common', 'Indéterminée');
switch ($job->type) {
case 1:
$jobType = Yii::t('jobModule.common', 'Permanent');
break;
case 2:
$jobType = Yii::t('jobModule.common', 'Temps partiel');
break;
case 3:
$jobType = Yii::t('jobModule.common', 'Saisonnier');
break;
case 4:
$jobType = $job->type;
break;
default:
$jobType = Yii::t('jobModule.common', 'Indéterminé');
}
// facebook OG Meta
Yii::app()->facebook->ogTags['og:site_name'] = Yii::app()->name;
Yii::app()->facebook->ogTags['og:title'] = $job->title;
Yii::app()->facebook->ogTags['og:type'] = "object";
//Yii::app()->facebook->ogTags['og:image'] = "http://".Yii::app()->request->serverName.Yii::app()->request->baseUrl."/images/ville-st-felicien-logo-facebook.jpg";
?>