mongator / mongator-bundle
用于在 Symfony2 中使用 Mongator 的包
v1.1.1
2014-05-31 00:51 UTC
Requires
- php: >=5.3.3
- mongator/mongator: 1.4.*
- symfony/framework-bundle: 2.*
- symfony/validator: 2.*
This package is not auto-updated.
Last update: 2024-09-14 15:16:32 UTC
README
用于使用 Mongator ODM 与 Symfony2 一起工作的包(由 MandangoBundle 衍生而来)。
入门
安装
要使用 Composer 安装 mongator-bundle,只需将以下内容添加到您的 composer.json 文件中
// composer.json { "require": { "mongator/mongator-bundle": "1.1.*" } }
然后更新依赖关系
$ php composer.phar update mongator/mongator-bundle
或者您可以用一条命令完成
$ php composer.phar require mongator/mongator-bundle:1.1.*
启用包
您需要在 AppKernel 中注册此包
// app/AppKernel.php class AppKernel extends Kernel { // ... public function registerBundles() { $bundles = array( // ..., new Mongator\MongatorBundle\MongatorBundle() ); // ... } }
配置 Mongator
将 Mongator 添加到您的配置中
# app/config/config.yml mongator: default_connection: local connections: local: server: mongodb://:27017 database: symfony2_local_%kernel.environment%
在开发环境中激活分析器
# app/config/config_dev.yml mongator: logging: true
文档
请参阅http://mandango.org/doc/中的文档。