本文整理汇总了PHP中Pager::pages方法的典型用法代码示例。如果您正苦于以下问题:PHP Pager::pages方法的具体用法?PHP Pager::pages怎么用?PHP Pager::pages使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pager
的用法示例。
在下文中一共展示了Pager::pages方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<td><?=Columns::output(Arr::path($ticket, 'static.'.$key), Columns::get_type($key))?></td>
<?php endforeach;?>
<td>
<table class="table subtable">
<tr class="same-yellow">
<th>Column name</th>
<th>Old value</th>
<th>New value</th>
<th>Current value</th>
</tr>
<?php foreach($ticket['data'] as $id => $value): $date = Columns::get_type($id) == 'date';?>
<tr class="submission <?=$value['old_value'] != $ticket['current'][$id] ? 'rose' : 'same-yellow' . (isset($_GET['discrepancy']) ? ' hidden' : '')?>">
<td><?=HTML::chars(Columns::get_name($id));?></td>
<td><?=HTML::chars($date ? date("d-m-Y H:i", $value['old_value'] ? : 0) : $value['old_value'])?></td>
<td><?=HTML::chars($date ? date("d-m-Y H:i", $value['new_value'] ? : 0) : $value['new_value'])?></td>
<td><?=HTML::chars($date ? date("d-m-Y H:i", $ticket['current'][$id] ? : 0) : $ticket['current'][$id])?></td>
</tr>
<?php endforeach;?>
</table>
</td>
</tr>
<?php endforeach;?>
</table>
<div class="col-xs-12 text-center">
<?php if (Pager::pages() > 1) echo $pager = View::factory('Pager');?>
</div>
<div class="col-xs-12">
<a class="pull-right btn btn-simple export-button" data-url="<?=URL::base()?>imex/discrepancies/export" href="javascript:;"><span class="glyphicon glyphicon-export"></span>Export to CSV</a>
</div>
<div class="clearfix"> </div>
<?php endif;?>
示例2:
</td>
</tr>
<?php
}
?>
</table>
<?php
echo View::factory('Pager');
if (User::current('is_admin')) {
?>
<div class="pull-right">
<a href="<?php
echo URL::base();
?>
orders/export?all" class="btn btn-info">Export All</a>
<?php
if (Pager::pages() > 1) {
?>
<a href="<?php
echo URL::base();
?>
orders/export<?php
echo URL::query();
?>
" class="btn btn-info">Export current page</a>
<?php
}
?>
</div>
<?php
}
示例3: if
<nav>
<ul class="pagination">
<?php if (Pager::pages() > 1):?>
<li <?=Pager::page() > 1 ? '' : 'class="disabled"'?>>
<a href="<?=URL::query(array('page' => max(1, Pager::page() - 1)))?>" aria-label="Previous"><span aria-hidden="true">«</span></a>
</li>
<?php for ($i = -3; $i<4; $i++) if (Pager::page() + $i > 0 && Pager::page() + $i <= Pager::pages()): $page = Pager::page() + $i;?>
<li <?=$i ? '' : 'class="active"'?>><a href="<?=URL::query(array('page' => $page))?>"><?=$page?></a></li>
<?php endif;?>
<li <?=Pager::page() < Pager::pages() ? '' : 'class="disabled"'?>>
<a href="<?=URL::query(array('page' => min(Pager::pages(), Pager::page() + 1)))?>" aria-label="Next"><span aria-hidden="true">»</span></a>
</li>
<?php endif;?>
<li>
<span>Total <?=Pager::$count?> records</span>
</li>
<li><span>Items on page:</span></li>
<?php foreach (Pager::$counts as $count):?>
<li <?=$count == Pager::limit() ? 'class="disabled"' : ''?>><a href="javascript:;" class="pager-count " data-value="<?=$count?>"><?=$count?></a></li>
<?php endforeach;?>
</ul>
</nav>
示例4: min
echo URL::query(array('page' => $page));
?>
"><?php
echo $page;
?>
</a></li>
<?php
}
}
?>
<li <?php
echo Pager::page() < Pager::pages() ? '' : 'class="disabled"';
?>
>
<a href="<?php
echo URL::query(array('page' => min(Pager::pages(), Pager::page() + 1)));
?>
" aria-label="Next"><span aria-hidden="true">»</span></a>
</li>
<?php
}
?>
<li>
<span>Total <?php
echo Pager::$count;
?>
records</span>
</li>
<li><span>Items on page:</span></li>
<?php
foreach (Pager::$counts as $count) {