【问题标题】:Overwrite an already generated form using doctrine:generate:form?使用教义覆盖已经生成的表单:generate:form?
【发布时间】:2023-03-04 01:16:01
【问题描述】:

运行时:

php app/console doctrine:generate:form ProjectFrontendBundle:Car

如果表单类型类已经存在,我会在下面收到此消息。

无法生成 CarType 表单类,因为它已经存在于 ~/workspace/certifi/src/Project/FrontendBundle/Form/CarType.php 文件

那么,是否可以覆盖已经生成的表单?

【问题讨论】:

    标签: symfony doctrine symfony-forms


    【解决方案1】:

    快速浏览一下app/console doctrine:generate:form -h,不幸的是:

    Options:
      -h, --help               Display this help message
      -q, --quiet              Do not output any message
      -V, --version            Display this application version
          --ansi               Force ANSI output
          --no-ansi            Disable ANSI output
      -n, --no-interaction     Do not ask any interactive question
      -s, --shell              Launch the shell.
          --process-isolation  Launch commands from shell as a separate process.
      -e, --env=ENV            The Environment name. [default: "dev"]
          --no-debug           Switches off debug mode.
      -v|vv|vvv, --verbose     Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
    

    我猜你只是删除了现有的类型类(或者 mv 如果你感到谨慎而不使用 vcs 的话)。

    【讨论】:

    • 这将是一个不错的功能,因为doctrine:generate:entities 会自动备份并重新生成现有实体。
    • 听起来是对命令的一个很好的改进,认为最好在 Github 上打开一个关于“强制覆盖”参数的问题。
    • 也许吧!我看看能不能找到时间:)
    猜你喜欢
    • 2012-02-20
    • 2017-08-31
    • 2015-05-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多