From 501eb29c2b1477df3b277aa58e7a7aecd3181b2e Mon Sep 17 00:00:00 2001 From: Alex Solis Date: Sat, 15 Jun 2024 17:40:38 -0700 Subject: [PATCH 1/2] [TwigComponent] Add documentation for MakerBundle installation docs: Document a quick way to get the component boilerplate in. --- src/TwigComponent/doc/index.rst | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/TwigComponent/doc/index.rst b/src/TwigComponent/doc/index.rst index 1c0bbde0d1d..e9aa4b5b3fd 100644 --- a/src/TwigComponent/doc/index.rst +++ b/src/TwigComponent/doc/index.rst @@ -58,7 +58,28 @@ Let's get this thing installed! Run: $ composer require symfony/ux-twig-component -That's it! We're ready to go! If you're not using Symfony Flex, add a config +You can now use the `MakerBundle`_ to get the skeleton of the Twig component made: + +.. code-block:: terminal + $ php bin/console make:twig-component + The name of your twig component (ie Notification): + > Notification + + Make this a live component? (yes/no) [no]: + > no + + created: src/Twig/Components/Notification.php + created: templates/components/Notification.html.twig + + + Success! + +This will also setup the config. + +Similarly, to make a `live component`_, enter ``yes`` when prompted whether +to make this a live component. + +If you're not using Symfony Flex, add a config file to control the template directory for your components: .. _default_config: @@ -72,6 +93,8 @@ file to control the template directory for your components: # Namespace & directory for components App\Twig\Components\: 'components/' +That's it! We're ready to go! + Component Basics ---------------- @@ -1662,6 +1685,7 @@ the Symfony framework: https://symfony.com/doc/current/contributing/code/bc.html .. _`Live Components`: https://symfony.com/bundles/ux-live-component/current/index.html +.. _`MakerBundle`: https://symfony.com/bundles/SymfonyMakerBundle/current/index.html .. _`live component`: https://symfony.com/bundles/ux-live-component/current/index.html .. _`Vue`: https://v3.vuejs.org/guide/computed.html .. _`Live Nested Components`: https://symfony.com/bundles/ux-live-component/current/index.html#nested-components From 9db894f68cdc30dbb7a8c7bff74f7f6abc74b835 Mon Sep 17 00:00:00 2001 From: Alex Solis Date: Sat, 15 Jun 2024 17:53:39 -0700 Subject: [PATCH 2/2] style: Accidentally removed CRLF after code block start. --- src/TwigComponent/doc/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TwigComponent/doc/index.rst b/src/TwigComponent/doc/index.rst index e9aa4b5b3fd..bba738a8d83 100644 --- a/src/TwigComponent/doc/index.rst +++ b/src/TwigComponent/doc/index.rst @@ -61,6 +61,7 @@ Let's get this thing installed! Run: You can now use the `MakerBundle`_ to get the skeleton of the Twig component made: .. code-block:: terminal + $ php bin/console make:twig-component The name of your twig component (ie Notification): > Notification