當前位置: 首頁>>代碼示例>>PHP>>正文


PHP zmf::formatTime方法代碼示例

本文整理匯總了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);
 }
開發者ID:ph7pal,項目名稱:momo,代碼行數:15,代碼來源:IndexController.php

示例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>
開發者ID:ph7pal,項目名稱:momo,代碼行數:31,代碼來源:_comment.php

示例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>
開發者ID:ph7pal,項目名稱:momo,代碼行數:31,代碼來源:_view.php

示例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 
}
開發者ID:ph7pal,項目名稱:momo,代碼行數:31,代碼來源:notice.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);
開發者ID:ph7pal,項目名稱:momo,代碼行數:16,代碼來源:view.php


注:本文中的zmf::formatTime方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。