trappar/alice-generator-bundle

用于从Doctrine实体生成Alice固定数据的Symfony扩展包

安装数: 169,010

依赖者: 1

建议者: 0

安全: 0

星标: 45

关注者: 2

分支: 12

公开问题: 6

类型:symfony-bundle

v2.0.1 2019-02-19 19:44 UTC

This package is auto-updated.

Last update: 2024-09-20 08:25:58 UTC


README

此扩展包将AliceGenerator库集成到Symfony中。

简介

TrapparAliceGeneratorBundle 允许您从现有数据生成Alice固定数据。

您可以在独立库的文档中了解更多信息。

目录

安装

composer require trappar/alice-generator-bundle

然后,通过更新您的app/AppKernel.php文件来启用此扩展包

<?php
// in AppKernel::registerBundles()

if (in_array($this->getEnvironment(), ['dev', 'test'])) {
    // ...
    $bundles[] = new Trappar\AliceGeneratorBundle\TrapparAliceGeneratorBundle();
    // ...
}

配置

TrapparAliceGeneratorBundle 无需初始配置即可开始使用。

有关所有可用配置选项,请参阅配置参考

使用方法

使用此扩展包的主要方法是包含的命令行应用程序。通过运行以下命令使用它:

console generate:fixtures

然后简单地按照提示进行操作。

您还可以从容器中请求FixtureGenerator服务

$fixtureGenerator = $container->get('trappar_alice_generator.fixture_generator');
$yaml = $fixtureGenerator->generateYaml($entities);

有关更多信息,请参阅专用库的文档

资源

鸣谢

此扩展包由Jeff Way开发,其中受到

其他贡献者的许多启发.

许可协议

license