本文整理汇总了PHP中CMS::date方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::date方法的具体用法?PHP CMS::date怎么用?PHP CMS::date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS
的用法示例。
在下文中一共展示了CMS::date方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: format_date
static function format_date($value, $data)
{
if (!isset($data['valid1970']) && $value == 0) {
return '';
}
if (isset($data['format'])) {
$format = $data['format'];
}
if (empty($format)) {
$format = 'd.m.Y';
if (isset($data['with_time']) && $data['with_time']) {
$format = 'd.m.Y - H:i';
}
if (isset($data['with_seconds']) && $data['with_seconds']) {
$format = 'd.m.Y - H:i:s';
}
}
return CMS::date($format, $value);
}
示例2: array
<div class="row">
<div class="col-md-7"><a class="lead" href="<?php
echo $data->getUrl();
?>
"><?php
echo Html::text($data->title);
?>
</a></div>
<div class="col-md-2 text-right">
<?php
$this->widget('ext.admin.frontControl.FrontControlWidget', array('data' => $data));
?>
</div>
<div class="col-md-3 text-right"><span class="icon-calendar-2"></span> <?php
echo CMS::date($data->date_create);
?>
<?php
$this->widget('mod.users.widgets.favorites.FavoritesWidget', array('model' => $data));
?>
</div>
</div>
</div>
<div class="panel-body">
<?php
echo Html::text($data->short_text);
?>
</div>
<div class="panel-footer navbar-collapse collapse">
<ul class="nav nav-pills">
<li><span class="icon-user"></span> <?php
示例3:
echo $children->level;
?>
">
<a href="#" title=""><img src="<?php
echo Html::encode($children->user_avatar);
?>
" width="50" alt="" /></a>
<div class="messageArea">
<span class="aro"></span>
<div class="infoRow">
<span class="name"><strong><?php
echo Html::encode($children->user_name);
?>
</strong> сказал:</span>
<span class="time"><?php
echo CMS::date($children->date_create);
?>
</span>
<?php
if ($children->controlTimeout()) {
?>
<div class="comment-panel">
<?php
echo $children->editLink;
?>
<?php
echo $children->deleteLink;
?>
</div>
<?php
}
示例4:
</td>
</tr>
<tr>
<td><?php
echo $label['date_registration'];
?>
</td>
<td><?php
echo CMS::date($user->date_registration);
?>
</td>
</tr>
<tr>
<td><?php
echo $label['last_login'];
?>
</td>
<td><?php
echo CMS::date($user->last_login);
?>
</td>
</tr>
</table>
<?php
} else {
Yii::app()->tpl->alert('info', 'Пользователь заблокирован');
}
if (Yii::app()->user->getIsSuperuser()) {
}
示例5: format_datetime
protected function format_datetime($value, $parms)
{
if ($value == '0000-00-00') {
return '';
}
$format = 'd.m.Y';
if (isset($parms['with_time']) && $parms['with_time'] || isset($parms['with_seconds']) && $parms['with_seconds']) {
$format .= ' - G:i';
}
if (isset($parms['with_seconds']) && $parms['with_seconds']) {
$format .= ':s';
}
return CMS::date($format, $value);
}
示例6: array
<form action="/admin/news/default/update?id=<?php
echo $model->id;
?>
" method="POST" id="edit_mode">
<h1 id="News[title]" class="edit_mode_title"><?php
echo Html::text($model->title);
?>
</h1>
<div class="date">
<span class="icon-calendar-2"></span>
<?php
echo CMS::date($model->date_create);
?>
</div>
<div class="edit_mode_text" id="News[short_text]"><?php
echo Html::text($model->short_text);
?>
</div>
<div class="edit_mode_text" id="News[full_text]"><?php
echo Html::text($model->full_text);
?>
</div>
</form>
<?php
if (Yii::app()->hasModule('comments')) {
$this->widget('mod.comments.widgets.comment.CommentWidget', array('model' => $model));
}
?>
示例7: render
public function render($force_format = false)
{
$data = $this->data;
$value = parent::value();
if (empty($value)) {
return '';
}
if (!isset($data['valid1970']) && CMS::date('Ymd', $value) == '19700101') {
return '';
}
if (isset($data['format'])) {
$format = $data['format'];
}
if ($force_format) {
$format = $force_format;
}
if (empty($format)) {
$format = 'd.m.Y';
if (isset($data['with_time']) && $data['with_time']) {
$format = 'd.m.Y - H:i';
}
if (isset($data['with_seconds']) && $data['with_seconds']) {
$format = 'd.m.Y - H:i:s';
}
}
$value = CMS::date($format, $value);
return $value;
}
示例8: array
echo Html::label('Главное', 'main_image_' . $image->id);
echo Html::radioButton('mainImageId', $image->is_main, array('value' => $image->id, 'class' => 'check', 'id' => 'main_image_' . $image->id));
?>
<div class="input-group">
<?php
echo Html::textField('image_titles[' . $image->id . ']', $image->title, array('placeholder' => 'Название изображение', 'class' => 'form-control'));
?>
<span class="input-group-btn">
<?php
echo Html::ajaxLink('<i class="flaticon-delete"></i>', $this->createUrl('deleteImage', array('id' => $image->id)), array('type' => 'POST', 'data' => array(Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken), 'success' => "js:\$('#ProductImage{$image->id}').hide().remove()"), array('id' => 'DeleteImageLink' . $image->id, 'class' => 'btn btn-danger', 'confirm' => Yii::t('ShopModule.admin', 'Вы действительно хотите удалить это изображение?')));
?>
</span>
</div>
<div class="actions" style="display: none;">
Дата: <?php
echo CMS::date($image->date_create);
?>
<br/>
Загрузил: <?php
echo $image->author ? Html::encode($image->author->login) : '';
?>
</div>
</div>
</div>
<?php
}
?>
示例9: foreach
foreach ($model->messages as $message) {
?>
<div class="media">
<div class="media-left media-middle">
<img class="media-object" src="<?php
//= $message->user->avatarUrl('50x50')
?>
" alt="">
</div>
<div class="media-body">
<h5 class="media-heading">
<?php
echo $message->user->login;
?>
<small><?php
echo CMS::date($message->date_create);
?>
</small>
</h5>
<p><?php
echo $message->text;
?>
</p>
</div>
</div>
<?php
}
?>
<?php
}
?>