geosocio / entity-attacher-bundle
Symfony 实体附加器 Bundle
2.0.1
2018-02-10 05:46 UTC
Requires
- geosocio/entity-attacher: ^1.0.4
- symfony/dependency-injection: ^3.0
- symfony/http-kernel: ^3.0
Requires (Dev)
- phpunit/phpunit: ^6.2
- squizlabs/php_codesniffer: ^3.0
README
为 实体附加器 库提供的 Syfmony Bundle。
安装
步骤 1:下载 Bundle
打开命令行控制台,进入您的项目目录,并执行以下命令以下载此 Bundle 的最新稳定版本
composer require geosocio/entity-attacher-bundle
此命令需要您已全局安装 Composer,如 Composer 文档的 安装章节 中所述。
步骤 2:启用 Bundle
然后,通过将其添加到项目 app/AppKernel.php
文件中注册的 Bundle 列表中来启用该 Bundle
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new GeoSocio\EntityAttacherBundle\GeoSocioEntityAttacherBundle(), ); // ... } // ... }
使用方法
$attached = $container->get('entity_attacher')->attach($object);