8000 feature #9489 Document make:crud (weaverryan) · symfony/symfony-docs@e523f0f · GitHub
[go: up one dir, main page]

Skip to content

Commit e523f0f

Browse files
committed
feature #9489 Document make:crud (weaverryan)
This PR was squashed before being merged into the 4.0 branch (closes #9489). Discussion ---------- Document make:crud In MakerBundle 1.2, we have a new `make:crud` command. It's not a huge thing that needs documentation - it just needs to be mentioned. Commits ------- 21d44fa fixing format + language fd5bd74 Documenting make:controller and make:crud
2 parents 7a740fe + 21d44fa commit e523f0f

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

controller.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,27 @@ in your controllers.
290290

291291
For more information about services, see the :doc:`/service_container` article.
292292

293+
Generating Controllers
294+
----------------------
295+
296+
To save time, you can also tell Symfony to generate a new controller class:
297+
298+
.. code-block:: terminal
299+
300+
$ php bin/console make:controller BrandNewController
301+
302+
created: src/Controller/BrandNewController.php
303+
304+
If you want to generate an entire CRUD from a Doctrine :doc:`entity </doctrine>`,
305+
use:
306+
307+
.. code-block:: terminal
308+
309+
$ php bin/console make:crud Product
310+
311+
.. versionadded::
312+
The ``make:crud`` command was introduced in MakerBundle 1.2.
313+
293314
.. index::
294315
single: Controller; Managing errors
295316
single: Controller; 404 pages

page_creation.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ You can now add your route directly *above* the controller:
125125
That's it! The page - ``http://localhost:8000/lucky/number`` will work exactly
126126
like before! Annotations are the recommended way to configure routes.
127127

128+
.. tip::
129+
130+
To create controllers faster, let Symfony generate it for you:
131+
132+
.. code-block:: terminal
133+
134+
$ php bin/console make:controller
135+
128136
.. _flex-quick-intro:
129137

130138
Auto-Installing Recipes with Symfony Flex

0 commit comments

Comments
 (0)
0