-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
base: 2.x
Are you sure you want to change the base?
Conversation
Add information on how to use the maker bundle to craete twig components, especially on how to create them in a subdirectory
There was a problem hiding this 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!
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`` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
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
Add information on how to use the maker bundle to craete twig components, especially on how to create them in a subdirectory