Symfony4 生成控制器命令
生成控制器
为了节省时间,您可以安装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
本作品采用《CC 协议》,转载必须注明作者和本文链接