Symfony4 生成控制器命令

hero-1011發表於2019-09-28

生成控制器
為了節省時間,您可以安裝Symfony Maker並告訴Symfony生成新的控制器類:

php bin/console make:controller BrandNewController

created: src/Controller/BrandNewController.php
created: templates/brandnew/index.html.twig

如果要從Doctrine 實體生成整個CRUD ,請使用:

php bin/console make:crud Product

created: src/Controller/ProductController.php
created: src/Form/ProductType.php
created: templates/product/_delete_form.html.twig
created: templates/product/_form.html.twig
created: templates/product/edit.html.twig
created: templates/product/index.html.twig
created: templates/product/new.html.twig
created: templates/product/show.html.twig

相關文章