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


PHP Paginator::get方法代码示例

本文整理汇总了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>
开发者ID:HarleyDavidson86,项目名称:bludit-themes,代码行数:31,代码来源:home.php

示例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>
开发者ID:hxii,项目名称:bludit,代码行数:31,代码来源:manage-posts.php

示例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>
开发者ID:hxii,项目名称:bludit-themes,代码行数:31,代码来源:home.php

示例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);
 }
开发者ID:a11enwong,项目名称:pochika,代码行数:22,代码来源:SiteController.php

示例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>
开发者ID:electronspin,项目名称:bludit,代码行数:30,代码来源:home.php

示例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 = '&amp;time';
         } elseif ($itype == 'type') {
             $out = '&amp;type';
         } elseif ($itype == 'size') {
             $out = '&amp;size';
         } elseif ($itype == 'chmod') {
             $out = '&amp;chmod';
         } elseif ($itype == 'uid') {
             $out = '&amp;uid';
         } elseif ($itype == 'gid') {
             $out = '&amp;gid';
         } else {
             $out = '';
         }
         $out .= $down ? '&amp;down' : '&amp;up';
         return $html . Paginator::get($pg, ListData::$getListCountPages, '&amp;c=' . $current . $out . $add);
     } else {
         return ListData::getListEmptyData();
     }
 }
开发者ID:Halilli,项目名称:gmanager,代码行数:45,代码来源:Gmanager.php

示例7: testEmpty

 public function testEmpty()
 {
     $res = Paginator::get([]);
     $this->assertNull($res['next_url']);
 }
开发者ID:a11enwong,项目名称:pochika,代码行数:5,代码来源:PaginatorTest.php


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