本文整理汇总了PHP中zmf::formatTime方法的典型用法代码示例。如果您正苦于以下问题:PHP zmf::formatTime方法的具体用法?PHP zmf::formatTime怎么用?PHP zmf::formatTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zmf
的用法示例。
在下文中一共展示了zmf::formatTime方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionMap
public function actionMap()
{
$this->layout = 'common';
$sql = "SELECT id,title,lat,`long`,comments,favorite,cTime FROM {{posts}} WHERE lat!='' AND `long`!='' AND `status`=1 ORDER BY cTime ASC";
Posts::getAll(array('sql' => $sql, 'pageSize' => 100), $pages, $posts);
foreach ($posts as $k => $val) {
$posts[$k]['href'] = Yii::app()->createUrl('posts/view', array('id' => $val['id']));
$posts[$k]['cTime'] = zmf::formatTime($val['cTime']);
}
$posts = !empty($posts) ? $posts : array();
$data = array('postJson' => CJSON::encode($posts), 'loadMap' => empty($posts) ? false : true);
$this->pageTitle = '足迹 - ' . zmf::config('sitename');
$this->selectNav = 'map';
$this->render('/index/map', $data);
}
示例2: nl2br
<div class="media" id="comment-<?php
echo $data['id'];
?>
">
<div class="media-body">
<p><b><?php
echo CHtml::encode($_uname);
?>
</b></p>
<p><?php
echo nl2br(CHtml::encode($data['content']));
?>
</p>
<p class="help-block">
<?php
echo zmf::formatTime($data['cTime']);
?>
<?php
if ($this->uid) {
?>
<span class="pull-right">
<?php
if ($this->uid != $postInfo['uid']) {
echo CHtml::link('回复', 'javascript:;', array('onclick' => "replyOne('" . $data['id'] . "','" . $data['logid'] . "','" . $_uname . "')"));
}
if ($this->uid == $postInfo['uid'] || $this->userInfo['isAdmin']) {
echo CHtml::link('删除', 'javascript:;', array('action' => 'del-content', 'action-type' => 'comment', 'action-data' => $data['id'], 'action-confirm' => 1, 'action-target' => 'comment-' . $data['id']));
}
?>
</span>
示例3: array
?>
<span style="color: red">[草稿]</span><?php
}
?>
</td>
<td class="text-center">
<?php
echo CHtml::encode($data->hits);
?>
| <?php
echo CHtml::encode($data->favors);
?>
</td>
<td>
<?php
echo zmf::formatTime($data->cTime);
?>
</td>
<td>
<?php
echo CHtml::link('预览', array('/posts/view', 'id' => $data->id), array('target' => '_blank'));
?>
<?php
echo CHtml::link('编辑', array('posts/update', 'id' => $data->id), array('target' => '_blank'));
?>
<?php
echo CHtml::link('删除', 'javascript:;', array('action' => 'del-content', 'action-type' => 'post', 'action-data' => $data->id, 'action-confirm' => 1));
?>
</td>
</tr>
示例4: foreach
foreach ($posts as $row) {
?>
<p class="<?php
echo $row['new'] ? 'font-bold' : 'help-block';
?>
" id="notice-<?php
echo $row['id'];
?>
">
<?php
echo $row['content'];
?>
<span class="pull-right">
<?php
echo zmf::formatTime($row['cTime']);
?>
<?php
echo CHtml::link('<i class="fa fa-remove"></i>', 'javascript:;', array('action' => 'del-content', 'action-type' => 'notice', 'action-data' => $row['id'], 'action-confirm' => 1, 'action-target' => 'notice-' . $row['id']));
?>
</span>
</p>
<?php
}
?>
<?php
$this->renderPartial('/common/pager', array('pages' => $pages));
?>
<?php
}
示例5: array
<?php
$a = Yii::app()->getController()->getAction()->id;
$this->menu = array('文章列表' => array('link' => array('siteInfo/index'), 'active' => in_array($a, array('index'))), '新增文章' => array('link' => array('siteInfo/create'), 'active' => in_array($a, array('create', 'update'))), '更新文章' => array('link' => array('siteInfo/update', 'id' => $model->id), 'active' => in_array($a, array('create', 'update'))), '文章详情' => array('link' => array('siteInfo/view', 'id' => $model->id), 'active' => in_array($a, array('view'))), '文章预览' => array('link' => array('/site/info', 'code' => $model->code)));
?>
<h1><?php
echo $model->title;
?>
</h1>
<p class="help-block">
<?php
echo zmf::formatTime($model->cTime);
?>
</p>
<?php
echo zmf::text(array(), $model->content, false);