当前位置: 首页>>代码示例>>PHP>>正文


PHP Paginator::pagination方法代码示例

本文整理汇总了PHP中Paginator::pagination方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::pagination方法的具体用法?PHP Paginator::pagination怎么用?PHP Paginator::pagination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Paginator的用法示例。


在下文中一共展示了Paginator::pagination方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Paginator

/admin/users/add">New</a>
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Email</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$users = $pagination->pagination($pagination_limit, 'user');
foreach ($users as $user) {
    echo '<tr>';
    echo '<td>' . $user['id'] . '</td>';
    echo '<td>' . $user['email'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/users/edit?id=' . $user['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/users/delete?id=' . $user['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'user');
?>
    </div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:users.php

示例2: Paginator

/admin/pages/add">New</a>
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Title</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$pages = $pagination->pagination($pagination_limit, 'page');
foreach ($pages as $page) {
    echo '<tr>';
    echo '<td>' . $page['id'] . '</td>';
    echo '<td>' . $page['title'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/pages/edit?id=' . $page['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/pages/delete?id=' . $page['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'page');
?>
    </div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:pages.php

示例3: Paginator

/admin/categories/add">New</a>
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Title</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$categories = $pagination->pagination($pagination_limit, 'category');
foreach ($categories as $category) {
    echo '<tr>';
    echo '<td>' . $category['id'] . '</td>';
    echo '<td>' . $category['title'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/categories/edit?id=' . $category['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/categories/delete?id=' . $category['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'category');
?>
    </div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:categories.php

示例4: Paginator

    </a>
    <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
        <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
    </a>
</div><!-- /.carousel -->

<div class="container home">

    <h1 class="page-header">Welcome</h1>
    <br/>

    <?php 
$pagination = new Paginator();
$pagination_limit = 3;
$posts = $pagination->pagination($pagination_limit, 'post', ' WHERE status = 1');
foreach ($posts as $post) {
    if (!empty($post['featured'])) {
        echo '<a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '"><img class="img-responsive" src="' . BASE_URL . '/gw-content/uploads/' . $post['featured'] . '" alt="' . $post['title'] . '" /></a>';
    }
    echo '<h2><a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '">' . $post['title'] . '</a></h2>';
    $categories = db_select("SELECT * FROM category WHERE id in (" . $post['category_id'] . ")");
    echo '<div class="small">';
    $created_date = $post['created_date'];
    $posted_date = date("F jS, Y", strtotime($created_date));
    echo '<span class="glyphicon glyphicon-calendar"></span>&nbsp;' . $posted_date;
    echo '&nbsp;&nbsp;';
    echo '<span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;';
    foreach ($categories as $category) {
        echo '<a href="' . BASE_URL . '/blog/category/' . $category['id'] . '/' . $category['slug'] . '">' . $category['title'] . '</a>&nbsp;';
    }
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:home.php

示例5: Paginator

/admin/posts/add">New</a>
    <div class="table-responsive">
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th>#</th>
                <th>Title</th>
                <th>Edit</th>
                <th>Delete</th>
            </tr>
            </thead>
            <tbody>
            <?php 
$pagination = new Paginator();
$pagination_limit = 10;
$posts = $pagination->pagination($pagination_limit, 'post');
foreach ($posts as $post) {
    echo '<tr>';
    echo '<td>' . $post['id'] . '</td>';
    echo '<td>' . $post['title'] . '</td>';
    echo '<td><a class="btn btn-warning" href="' . BASE_URL . '/admin/posts/edit?id=' . $post['id'] . '">Edit</a></td>';
    echo '<td><a class="delete btn btn-danger" href="' . BASE_URL . '/admin/posts/delete?id=' . $post['id'] . '">Delete</a></td>';
    echo '</tr>';
}
?>
            </tbody>
        </table>
        <?php 
$pagination->pagination_links($pagination_limit, 'post');
?>
    </div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:posts.php

示例6: Paginator

<div class="container">
    <h1 class="page-header"><?php 
echo $category['title'];
?>
</h1>
    <p><?php 
if (!empty($category['description'])) {
    echo $category['description'];
}
?>
</p>
    <?php 
$searched_id = $category_lookup->category_id_search($category['id'], $id);
$pagination = new Paginator();
$pagination_limit = 3;
$posts = $pagination->pagination($pagination_limit, 'post', ' WHERE category_id = ' . $searched_id . ' AND status = 1');
foreach ($posts as $post) {
    if (!empty($post['featured'])) {
        echo '<a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '"><img class="img-responsive" src="' . BASE_URL . '/gw-content/uploads/' . $post['featured'] . '" alt="' . $post['title'] . '" /></a>';
    }
    echo '<h2><a href="' . BASE_URL . '/blog/' . $post['id'] . '/' . $post['slug'] . '">' . $post['title'] . '</a></h2>';
    $categories = db_select("SELECT * FROM category WHERE id in (" . $post['category_id'] . ")");
    echo '<div class="small">';
    $created_date = $post['created_date'];
    $posted_date = date("F jS, Y", strtotime($created_date));
    echo '<span class="glyphicon glyphicon-calendar"></span>&nbsp;' . $posted_date;
    echo '&nbsp;&nbsp;';
    echo '<span class="glyphicon glyphicon-folder-open"></span>&nbsp;&nbsp;';
    foreach ($categories as $category) {
        echo '<a href="' . BASE_URL . '/blog/category/' . $category['id'] . '/' . $category['slug'] . '">' . $category['title'] . '</a>&nbsp;';
    }
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:category.php

示例7: pagination

 /**
  * Pagination with query and row count (better for large sets of data)
  *
  * @param string $query - SQL query
  * @param int $total_items - total row count
  * @param int $items_per_page
  * @param string $cache_table - must provide a table, e.g. "posts" for caching to be used
  * @return object|false - object
  */
 public function pagination($query, $total_items, $items_per_page = 10, $cache_table = '')
 {
     require_once LIBS . 'Paginator.php';
     $paginator = new Paginator();
     return $paginator->pagination($this, $query, $total_items, $items_per_page, $cache_table);
 }
开发者ID:shibuya246,项目名称:Hotaru-Plugins,代码行数:15,代码来源:Hotaru.php


注:本文中的Paginator::pagination方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。