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


PHP Articles::limit_text方法代碼示例

本文整理匯總了PHP中Articles::limit_text方法的典型用法代碼示例。如果您正苦於以下問題:PHP Articles::limit_text方法的具體用法?PHP Articles::limit_text怎麽用?PHP Articles::limit_text使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Articles的用法示例。


在下文中一共展示了Articles::limit_text方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: while

                          
                        <div class="table-responsive" id="tablelist">
                          <table class="table">
                                <thead>
                                  <tr>
                                    <th>Title</th>
                                   <!-- <th>Content</th>-->
                                    <th>Category</th>
                                    <th>Edit</th>
                                  </tr>
                                </thead>
                                 <tbody>
                                    <?php 
if ($result != "No articles") {
    while ($row = $result->fetch_assoc()) {
        $content = $articles->limit_text($row['article_content'], 300);
        echo '<tr>';
        echo "<td>" . $row['article_name'] . "</td>";
        // echo "<td>".$content."</td>";
        echo "<td>" . $row['category_name'] . "</td>";
        echo "<td><a target='_blank' href='articleview.php?aid=" . $row['article_id'] . "'' class='btn btn-success'><span class='glyphicon glyphicon-folder-open'></span></a> <a target='_blank' href='articleupdate.php?aid=" . $row['article_id'] . "' class='btn btn-success'><span class='glyphicon glyphicon-pencil'></span></a> <button class='btn btn-success'  id='" . $row['article_id'] . "' onclick='req(id)'><span id='delete'class='glyphicon glyphicon-trash'></span></button></td>";
        echo '</tr>';
    }
} else {
    echo "<tr><p> Currently User Have Not Any Article</p></tr>";
}
?>
                                 </tbody>
                          </table>
                        </div>
                    </div>
開發者ID:ahmedkhan847,項目名稱:customcms,代碼行數:30,代碼來源:articlelist.php

示例2: ucwords

        $count = 0;
    }
    ?>
<div class="col-sm-4">
      <div class="panel panel-primary">
        <div class="panel-heading home links"><?php 
    echo $row['article_name'];
    ?>
</div>
        <div class="panel-body"><img src="articleimage/<?php 
    echo $row['img'];
    ?>
" class="img-responsive img-circle" style="width:100%" alt="Image">
          <p> <?php 
    $aid = $row['url'];
    echo $view->limit_text($row['article_content']) . " " . "<a href='{$aid}'>read more...</a>";
    //echo $row['article_content'];
    ?>
 </p>
        </div>
        <div class="panel-footer"><p> Post by <?php 
    echo ucwords($row['u_fname']) . " " . ucwords($row['u_lname']) . "," . $row['dates'];
    ?>
.
        <br><span class="label label-danger"><?php 
    echo $row['category_name'];
    ?>
</span></p></div>
      </div>
    </div>
開發者ID:ahmedkhan847,項目名稱:customcms,代碼行數:30,代碼來源:index.php


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