本文整理汇总了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>
示例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>
示例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>
示例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> ' . $posted_date;
echo ' ';
echo '<span class="glyphicon glyphicon-folder-open"></span> ';
foreach ($categories as $category) {
echo '<a href="' . BASE_URL . '/blog/category/' . $category['id'] . '/' . $category['slug'] . '">' . $category['title'] . '</a> ';
}
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>
示例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>
示例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> ' . $posted_date;
echo ' ';
echo '<span class="glyphicon glyphicon-folder-open"></span> ';
foreach ($categories as $category) {
echo '<a href="' . BASE_URL . '/blog/category/' . $category['id'] . '/' . $category['slug'] . '">' . $category['title'] . '</a> ';
}
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>