styde / blade-pagination
支持 Blade 模板引擎的 Laravel 分页组件
Requires
- php: >=5.4.0
- laravel/framework: 5.*
This package is auto-updated.
Last update: 2024-09-06 08:08:29 UTC
README
本包与 Laravel 5.0 和 Laravel 5.1 兼容(但如果你使用的是 Laravel 5.0,建议更新到 5.1,大约需要 20 分钟左右)
还有一个仓库可以快速尝试/测试此包: https://github.com/StydeNet/blade-pagination-tests (其中包含一些使用 phpunit 的自动测试)。
安装
通过 Composer 安装
1 - 将以下指令添加到 composer.json 文件中的 "require" 选项
"styde/blade-pagination": "5.1.*@dev"
并在项目文件夹内的控制台中执行 composer update
。
或在项目文件夹内的控制台中执行 composer require styde/blade-pagination:5.1.*@dev
。
2 - 将服务提供者添加到 Laravel 应用的 config/app.php 文件中
'Styde\BladePagination\ServiceProvider'
3 - 要更改模板,请在控制台中执行以下命令
php artisan vendor:publish
4 - 然后
可以在 config/blade-pagination.php 中更改主题(如果需要),例如
return array( 'theme' => 'bootstrap' );
有 3 个可用选项:bootstrap
,foundation
和 materialize
。
在 resources/views/blade-pagination 目录中更改模板(确保根据 config/blade-pagination.php 中指定的主题编辑或添加新模板)
或者,你可以直接复制以下代码
<?php
/***
* Choose from: bootstrap, foundation, materialize
* or create your own theme inside resources/views/pagination/
* If you create a theme for a popular CSS framework
* Please submit a pull request to: https://github.com/styde/blade-pagination
* Or send me the template to admin@styde.net
*/
return array(
'theme' => 'bootstrap'
);
创建主题
你可以在 resources/views/pagination 中创建自己的主题。请随时通过 Pull Request 提交你的主题,或发送到 admin@styde.net
。