本文整理汇总了PHP中Crud::pagination方法的典型用法代码示例。如果您正苦于以下问题:PHP Crud::pagination方法的具体用法?PHP Crud::pagination怎么用?PHP Crud::pagination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Crud
的用法示例。
在下文中一共展示了Crud::pagination方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: select
public function select()
{
$pagination = $this->_config['pagination'];
$search = $this->_config['search'];
$whereList = '';
if (ake('whereList', $this->_config)) {
$whereList = $this->_config['whereList'];
}
$order = !strlen($this->_request->getCrudOrder()) ? $this->_config['defaultOrder'] : $this->_request->getCrudOrder();
$orderDirection = !strlen($this->_request->getCrudOrderDirection()) ? $this->_config['defaultOrderDirection'] : $this->_request->getCrudOrderDirection();
$export = !strlen($this->_request->getCrudTypeExport()) ? null : $this->_request->getCrudTypeExport();
$offset = !strlen($this->_request->getCrudNumPage()) ? 0 : $this->_request->getCrudNumPage() * $this->_config['itemsByPage'];
$limit = $this->_config['itemsByPage'];
$where = !strlen($this->_request->getCrudWhere()) ? '' : Project::makeQuery($this->_request->getCrudWhere(), $this->_type);
$data = Project::query($this->_type, $where, 0, 0, $order, $orderDirection);
$count = count($data);
if (true === $pagination) {
$pageNumber = $offset / $limit < 1 ? 1 : $offset / $limit;
$paginator = Paginator::make($data, $count, $limit);
$this->_items = $paginator->getItemsByPage($pageNumber);
$this->_pagination = Crud::pagination($paginator);
} else {
$this->_items = $data;
}
if (0 < $count && null !== $export) {
$method = 'export' . ucfirst(Inflector::lower($export));
return Crud::$method($data, $this->_em);
}
if (true === $search) {
$this->makeSearch();
}
return $this;
}
示例2:
echo _SPPATH;
echo $webClass;
?>
/<?php
echo $c;
?>
?cmd=edit&id=<?php
echo $obj->{$main_id};
?>
&parent_page=' + window.selected_page, 'fade');
});
</script>
<?php
}
?>
</table>
</div>
<div class="row hidden-print">
<div class="col-md-12">
<?php
Crud::pagination($arr, $webClass);
?>
</div>
</div>
<?php
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
示例3: bankDiscountModel
//.........这里部分代码省略.........
if ($colom == "removeAutoCrudClick") {
continue;
}
?>
<th id="sort_<?php
echo $colom;
echo $t;
?>
"><?php
echo Lang::t($colom);
?>
</th>
<?php
Crud::sortBy($arr, $webClass, "sort_" . $colom . $t, $colom);
}
}
?>
</tr>
<?php
foreach ($objs as $num => $obj) {
?>
<tr id="<?php
echo $c;
?>
_<?php
echo $obj->{$main_id};
?>
">
<?php
foreach ($obj as $colom => $isi) {
if ($colom == "removeAutoCrudClick") {
continue;
}
?>
<td id="<?php
echo $colom;
?>
_<?php
echo $obj->{$main_id};
?>
">
<?php
echo stripslashes($isi);
?>
</td>
<?php
if (!in_array($colom, $obj->removeAutoCrudClick)) {
?>
<script type="text/javascript">
$("#<?php
echo $colom;
?>
_<?php
echo $obj->{$main_id};
?>
").click(function () {
openLw('<?php
echo $webClass;
?>
View', '<?php
echo _SPPATH;
echo $webClass;
?>
/<?php
echo $c;
?>
?cmd=edit&id=<?php
echo $obj->{$main_id};
?>
&parent_page=' + window.selected_page+'&loadagain='+$.now(), 'fade');
});
</script>
<?php
}
?>
<?php
}
?>
</tr>
<?php
}
?>
</table>
</div>
<div class="row hidden-print">
<div class="col-md-12">
<?php
Crud::pagination($arr, $webClass);
?>
</div>
</div>
<?php
// pr($mps);
}