Skip to content
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

Add maker bundle information #2384

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

DennisdeBest
Copy link
Contributor

@DennisdeBest DennisdeBest commented Nov 16, 2024

Add information on how to use the maker bundle to craete twig components, especially on how to create them in a subdirectory

Q A
Bug fix? no
New feature? no

Add information on how to use the maker bundle to craete twig components, especially on how to create them in a subdirectory
@carsonbot carsonbot added Bug Bug Fix Feature New Feature Status: Needs Review Needs to be reviewed labels Nov 16, 2024
Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

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

Hi @DennisdeBest, while I find this addition very nice, I think it's too much verbose, the Twig Component documentation is already so long!

A small paragraph inside a .. tip with a simple example and a link to the MakerBundle would be enough.
We do not need to:

  • tell about creating a component in a sub-directory, this should be documented in Maker's documentation
  • tell what and where files were created, since the command already display this information

Thanks!

Comment on lines +125 to +144
You can also use the ``make`` commands to generate the component PHP and twig files :

.. code-block:: terminal

$ php bin/console make:twig-component Alert

If you want your component to reside in a sub directory like ``src/twig/Components/Alert/`` and make a specific component for a Danger alert you can run:

.. code-block:: terminal

$ php bin/console make:twig-component Alert\\Danger

Or:

.. code-block:: terminal

$ php bin/console make:twig-component 'Alert\Danger'

This wil render the php file at ``src\twig\Components\Alert\Danger.php`` and the twig file at ``templates\components\Alert\Danger.html.twig``

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
You can also use the ``make`` commands to generate the component PHP and twig files :
.. code-block:: terminal
$ php bin/console make:twig-component Alert
If you want your component to reside in a sub directory like ``src/twig/Components/Alert/`` and make a specific component for a Danger alert you can run:
.. code-block:: terminal
$ php bin/console make:twig-component Alert\\Danger
Or:
.. code-block:: terminal
$ php bin/console make:twig-component 'Alert\Danger'
This wil render the php file at ``src\twig\Components\Alert\Danger.php`` and the twig file at ``templates\components\Alert\Danger.html.twig``
.. tip
If you use the Symfony Maker Bundle (...):
.. code-block:: terminal
$ php bin/console make:twig-component Alert

Is enough, feel free to complete the first sentence

Copy link
Member

Choose a reason for hiding this comment

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

I'd like this block to be later in the doc... maybe with just a link here pointing at this block ?

I feel it's a bit early to tell people to run "make component" when the full concept, the paths, etc... are not yet explained

@carsonbot carsonbot added Status: Needs Work Additional work is needed and removed Status: Needs Review Needs to be reviewed labels Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Feature New Feature Status: Needs Work Additional work is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants