mqm / pagination-bundle
Symfony PaginationBundle
dev-master
2012-09-20 16:50 UTC
Requires
- php: >=5.3.2
- symfony/framework-bundle: 2.*
- symfony/security-bundle: 2.*
Suggests
- doctrine/couchdb-odm-bundle: *
- symfony/doctrine-bundle: *
- symfony/mongodb-odm-bundle: *
This package is not auto-updated.
Last update: 2024-09-22 02:53:35 UTC
README
MQMPaginationBundle 是什么?
MQMPagination Bundle 是一个允许您将分页功能集成到网站中的 Symfony2 扩展包。
此扩展包是 [MQMShoppingBox][1] 的一部分,它是一组用于构建电子商务网站的扩展包。
查看 [ShoppingBox],了解如何使用此扩展包。
需求
此扩展包利用了一些库和扩展包。您需要
- [DoctrineExtensions][2] 用于可缩写和树扩展(配置详情见下面的 安装 部分)。
安装
将 MQMPaginationBundle 添加到您的 vendors
You have two options, by modifying your dep file or creating a submodule
- Option 1: Editing deps file:
//deps
// ...
[PaginationBundle]
git=http://github.com/mqmtech/PaginationBundle.git
target=/bundles/MQM/PaginationBundle
$ php bin/vendors update
- Option 2: submodule command
$ git submodule add git://github.com/mqmtech/PaginationBundle.git vendor/bundles/MQM/PaginationBundle
将 PaginationBundle 添加到您的 autoload
// app/autoload.php
$loader->registerNamespaces(array(
// ...
'MQM' => __DIR__.'/../vendor/bundles',
// ...
));
将 PaginationBundle 添加到您的应用程序内核
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new MQM\Bundles\PaginationBundle\MQMPaginationBundle(),
);
// ...
return $bundles;
}
将 MQMPaginationBundle 路由规则添加到您的应用程序(这应该是 routing.yml 文件中的最后一项)
# app/config/routing.yml
# ...
MQMPaginationBundle:
resource: "@MQMPaginationBundle/Resources/config/routing.yml"
prefix: /
将资源添加到您的 web 目录
$ ./app/console assets:install --symlink web
重建模型并更新您的模式
$ ./app/console doctrine:generate:entities
$ ./app/console doctrine:schema:update --force
配置
# app/config/config.yml
mqm_pagination:
limit_per_page: 6