4h/generatorbundle

代码生成包,扩展了 symfony 的标准 sensio 生成包。

安装: 89

依赖: 0

建议: 0

安全: 0

类型:symfony-bundle

dev-master 2016-03-04 15:24 UTC

This package is not auto-updated.

Last update: 2024-10-02 10:36:04 UTC


README

这是一个扩展 symfony sensio 生成包的包。

您可以使用此生成包生成三件事情,它通过命令行像 sensio 生成包一样工作。

  1. 要创建消费者,运行此命令

php app/console generate:consumer --no-interaction --bundleName=[bundleName] --consumerName=[consumerName]

示例

consumer --no-interaction --bundleName=QuoteWriteBundle --consumerName=Quote

  1. 要创建控制器,运行此命令

php app/console generate:RESTcontroller --no-interaction --controller=bundleName:controllerName --type=type --action=getall --fields="fields"

示例

php app/console generate:RESTcontroller --no-interaction --controller=QuoteWriteBundle:Quote --type=write --action=putevent --fields="guid:string tenderGuid:string author:string price:float "

  1. 要创建文档,运行此命令

php app/console generate:doctrine:document --no-interaction --document=bundleName:documentName --fields="fields" --format=yml

示例

php app/console generate:doctrine:document --no-interaction --document=QuoteWriteBundle:Quote --fields="guid:string tenderGuid:string author:string price:float " --format=yml