本文整理汇总了PHP中Paginator::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::get方法的具体用法?PHP Paginator::get怎么用?PHP Paginator::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
echo $Language->g('Posted By') . ' ' . $Post->user('username') . ' ' . $Post->date();
?>
</p>
</div>
<!-- Plugins Post End -->
<?php
Theme::plugins('postEnd');
?>
<hr>
<?php
}
?>
<!-- Pager -->
<ul class="pager">
<?php
if (Paginator::get('showNewer')) {
echo '<li class="previous"><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('prevPage') . '">Previous</a></li>';
}
if (Paginator::get('showOlder')) {
echo '<li class="next"><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('nextPage') . '">Next</a></li>';
}
?>
</ul>
</div>
</div>
</div>
示例2: elseif
$status = false;
if ($Post->scheduled()) {
$status = $Language->g('Scheduled');
} elseif (!$Post->published()) {
$status = $Language->g('Draft');
}
echo '<tr>';
echo '<td><a href="' . HTML_PATH_ADMIN_ROOT . 'edit-post/' . $Post->key() . '">' . ($status ? '<span class="label-draft">' . $status . '</span>' : '') . ($Post->title() ? $Post->title() : '<span class="label-empty-title">' . $Language->g('Empty title') . '</span> ') . '</a></td>';
echo '<td class="uk-text-center">' . $Post->dateRaw() . '</td>';
echo '<td><a target="_blank" href="' . $Post->permalink() . '">' . $Url->filters('post') . '/' . $Post->key() . '</a></td>';
echo '</tr>';
}
echo '
</tbody>
</table>
';
?>
<div id="paginator">
<ul>
<?php
if (Paginator::get('showNewer')) {
echo '<li class="previous"><a href="' . HTML_PATH_ADMIN_ROOT . 'manage-posts?page=' . Paginator::get('prevPage') . '">« ' . $Language->g('Prev page') . '</a></li>';
}
echo '<li class="list">' . (Paginator::get('currentPage') + 1) . ' / ' . (Paginator::get('numberOfPages') + 1) . '</li>';
if (Paginator::get('showOlder')) {
echo '<li class="next"><a href="' . HTML_PATH_ADMIN_ROOT . 'manage-posts?page=' . Paginator::get('nextPage') . '">' . $Language->g('Next page') . ' »</a></li>';
}
?>
</ul>
</div>
示例3: foreach
<?php
$tags = $Post->tags(true);
foreach ($tags as $tagKey => $tagName) {
echo '<li><a href="' . HTML_PATH_ROOT . $Url->filters('tag') . '/' . $tagKey . '">' . $tagName . '</a></li>';
}
?>
</ul>
</footer>
<!-- Plugins Post End -->
<?php
Theme::plugins('postEnd');
?>
</article>
<?php
}
?>
<!-- Pagination -->
<ul class="actions pagination">
<?php
if (Paginator::get('showNewer')) {
echo '<li><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('prevPage') . '" class="button big previous">Previous Page</a></li>';
}
if (Paginator::get('showOlder')) {
echo '<li><a href="' . HTML_PATH_ROOT . '?page=' . Paginator::get('nextPage') . '" class="button big next">Next Page</a></li>';
}
?>
</ul>
示例4: search
/**
* search
*
* @return Response
*/
public function search()
{
$query = Input::get('q');
$page = Input::get('page');
$posts = [];
if ($query) {
$posts = Post::search($query);
}
if (count($posts)) {
$url = sprintf('/search?q=%s&page=:page', rawurlencode($query));
$paginator = Paginator::get($posts, $page, $url);
} else {
$paginator = null;
}
$html = Layout::find('search')->render(['search' => true, 'query' => $query, 'paginator' => $paginator]);
return Response::make($html);
}
示例5: foreach
$tags = $Post->tags(true);
foreach ($tags as $tagKey => $tagName) {
echo '<li><a href="' . HTML_PATH_ROOT . $Url->filters('tag') . '/' . $tagKey . '">' . $tagName . '</a></li>';
}
?>
</ul>
</footer>
<!-- Plugins Post End -->
<?php
Theme::plugins('postEnd');
?>
</article>
<?php
}
?>
<!-- Pagination -->
<ul class="actions pagination">
<?php
if (Paginator::get('showNewer')) {
echo '<li><a href="' . Paginator::urlPrevPage() . '" class="button previous">Previous Page</a></li>';
}
if (Paginator::get('showOlder')) {
echo '<li><a href="' . Paginator::urlNextPage() . '" class="button next">Next Page</a></li>';
}
?>
</ul>
示例6: look
/**
* look
*
* @param string $current
* @param string $itype
* @param string $down
* @return string
*/
public function look($current = '', $itype = '', $down = '')
{
if (self::$_instance->is_link($current)) {
$link = self::$_instance->readlink($current);
$current = $link[1] . '/';
}
if (!self::$_instance->is_dir($current)) {
return ListData::getListNotFoundData();
}
if (!self::$_instance->is_readable($current)) {
return ListData::getListDenyData();
}
$add = isset($_GET['add_archive']) ? $_GET['add_archive'] : '';
$pg = isset($_GET['pg']) ? $_GET['pg'] : 1;
$html = ListData::getListData($current, $itype, $down, $pg, $add);
if ($html) {
if ($itype == 'time') {
$out = '&time';
} elseif ($itype == 'type') {
$out = '&type';
} elseif ($itype == 'size') {
$out = '&size';
} elseif ($itype == 'chmod') {
$out = '&chmod';
} elseif ($itype == 'uid') {
$out = '&uid';
} elseif ($itype == 'gid') {
$out = '&gid';
} else {
$out = '';
}
$out .= $down ? '&down' : '&up';
return $html . Paginator::get($pg, ListData::$getListCountPages, '&c=' . $current . $out . $add);
} else {
return ListData::getListEmptyData();
}
}
示例7: testEmpty
public function testEmpty()
{
$res = Paginator::get([]);
$this->assertNull($res['next_url']);
}