Skip to content

[TwigComponent] Add documentation for MakerBundle installation #1923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/TwigComponent/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,29 @@ 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean here ? How does the maker bundle set the local config ?


Similarly, to make a `live component`_, enter ``yes`` when prompted whether
to make this a live component.
Comment on lines +80 to +81
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should talk about LiveComponent that early in the page.


If you're not using Symfony Flex, add a config
file to control the template directory for your components:

.. _default_config:
Expand All @@ -72,6 +94,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!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the way it was before. For most of new users, composer require will be enough.


Component Basics
----------------

Expand Down Expand Up @@ -1662,6 +1686,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
Expand Down