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


PHP Paginator::pagination_links方法代码示例

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


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

示例1: Paginator

    <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>
</div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:pages.php

示例2: Paginator

    <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>
</div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:users.php

示例3: Paginator

    <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>
</div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:categories.php

示例4: Paginator

    <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;';
    }
    echo '</div>';
    $body = Post::read_more($post['body'], 50);
    echo $body;
    echo '<hr class="featurette-divider">';
}
//Pagination links
$pagination->pagination_links($pagination_limit, 'post', ' WHERE status = 1');
?>
</div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:home.php

示例5: Paginator

    <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>
</div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:posts.php

示例6: Paginator

?>
</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;';
    }
    echo '</div>';
    $body = Post::read_more($post['body'], 50);
    echo '' . $body . '';
    echo '<hr class="featurette-divider">';
}
//Pagination links
$pagination->pagination_links($pagination_limit, 'post', ' WHERE status = 1 AND category_id = ' . $category['id'] . '');
?>
</div>
开发者ID:gwhitcher,项目名称:gwpress,代码行数:31,代码来源:category.php


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