本文整理汇总了PHP中tools::formatTime方法的典型用法代码示例。如果您正苦于以下问题:PHP tools::formatTime方法的具体用法?PHP tools::formatTime怎么用?PHP tools::formatTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tools
的用法示例。
在下文中一共展示了tools::formatTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$_uname = Users::getUserInfo($data['uid'], 'truename');
?>
<div class="media zmf-border-bottom" id="comment_<?php
echo $data['id'];
?>
">
<div class="media-body">
<p><?php
echo CHtml::link($_uname, array('index/media', 'id' => $data['uid']), array('target' => '_blank'));
if ($data['tocommentid'] > 0) {
$cominfo = Posts::getSimpleInfo($data['tocommentid'], 'comments');
$_cuname = Users::getUserInfo($cominfo['uid'], 'truename');
?>
回复 <?php
$this->renderPartial('/common/_user', array('uid' => $cominfo['uid'], 'uname' => $_cuname, 'type' => 'l'));
}
?>
</p>
<p><?php
echo zmf::filterOutput($data['content'], true);
?>
</p>
<p class="color-grey"><?php
echo tools::formatTime($data['cTime']);
?>
</p>
</div>
</div>
示例2: foreach
foreach ($posts as $row) {
?>
<p class="help-block" <?php
if ($row['new']) {
?>
style="font-weight: bold" <?php
}
?>
>
<span><?php
echo zmf::filterOutput($row['content']);
?>
</span>
<span class="pull-right">
<?php
echo tools::formatTime($row['cTime']);
?>
<?php
echo CHtml::link('<span class="icon-remove"></span>', 'javascript:', array('onclick' => 'deletePost("' . $row['id'] . '","notice","' . Yii::app()->createUrl('users/notice') . '")'));
?>
</span>
</p>
<?php
}
$this->renderPartial('//common/pager', array('pages' => $pages));
} else {
?>
<p class="help-block">暂无提醒。</p>
<?php
}
示例3: isset
<?php
if (!$userInfo) {
$userInfo = Users::getUserInfo($data['uid']);
}
$_uname = $userInfo['truename'];
$_imgsize = isset($imgsize) ? $imgsize : 170;
$formatTime = '';
if ($data['lastupdate'] > $data['cTime']) {
$formatTime = '更新于' . tools::formatTime($data['lastupdate']);
} else {
$formatTime = tools::formatTime($data['cTime']);
}
$areaInfo = Area::getOneInfo($data['areaid']);
$toAreaInfo = Area::getOneInfo($data['toAreaid']);
?>
<div class="media <?php
echo $noborder == 'yes' ? '' : 'zmf-border-bottom';
?>
">
<div class="media-left">
<?php
$this->renderPartial('/common/_user', array('uid' => $data['uid'], 'uname' => $_uname, 'type' => 'a'));
?>
</div>
<div class="media-body poi-tips-body">
<p class="author">
<?php
$this->renderPartial('/common/_user', array('uid' => $data['uid'], 'uname' => $_uname, 'type' => 'l', 'lcss' => ''));
?>
<?php
示例4: array
<?php
$_userInfo = Users::getUserInfo($data['uid']);
$formatTime = tools::formatTime($data['updateTime']);
$title = '';
if ($data['coltitle']) {
$title = '【' . $data['coltitle'] . '】' . $data['title'];
} else {
$title = $data['title'];
}
?>
<div class="media zmf-border-bottom"><?php
if ($data['faceimg']) {
?>
<div class="media-left"><a href="<?php
echo Yii::app()->createUrl('posts/view', array('id' => $data['id']));
?>
"><img src="<?php
echo zmf::lazyImg();
?>
" class="lazy" width="66" height="50" data-original="<?php
echo $data['faceimg'];
?>
" alt="<?php
echo $title;
?>
的封面图"/></a></div><?php
}
?>
<div class="media-body post-body"><p class="title"><?php
echo CHtml::link(zmf::filterOutput($title, true), array('posts/view', 'id' => $data['id']));