Skip to content

Commit 9b4b36f

Browse files
committed
feature symfony#4236 Javiereguiluz bundle install instructions (WouterJ)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes symfony#4236). Discussion ---------- Javiereguiluz bundle install instructions Replaces symfony#4163 Commits ------- 7097070 Added the fixes suggested by Ryan 35dddba Reworded a bit the installation instructions 7a6644b Removed the sidebar and made some minor tweaks 41ce2a5 Minor fixes and tweaks 4b29de2 More tweaks and fixes 322ec60 Removed the first person perspective and other minor fixes c39f7d3 Fixed some code formatting ed96447 More improvements based on reviewers' comments 21ce2c0 Fixed minor typo 11db860 Applied all the fixes and suggestions made by reviewers b297d29 First draft of the bundle installation instructions
2 parents 9fd91d6 + 13e369d commit 9b4b36f

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

cookbook/bundles/best_practices.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,59 @@ Extensive documentation should also be provided in the
194194
the ``Resources/doc/`` directory; the ``Resources/doc/index.rst`` file is
195195
the only mandatory file and must be the entry point for the documentation.
196196

197+
Installation Instructions
198+
~~~~~~~~~~~~~~~~~~~~~~~~~
199+
200+
In order to ease the installation of third-party bundles, consider using the
201+
following standardized instructions in your ``README.md`` file.
202+
203+
.. code-block:: text
204+
205+
Installation
206+
============
207+
208+
Step 1: Download the Bundle
209+
---------------------------
210+
211+
Open a command console, enter your project directory and execute the
212+
following command to download the latest stable version of this bundle:
213+
214+
```bash
215+
$ composer require <package-name> "~1"
216+
```
217+
218+
This command requires you to have Composer installed globally, as explained
219+
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
220+
of the Composer documentation.
221+
222+
Step 2: Enable the Bundle
223+
-------------------------
224+
225+
Then, enable the bundle by adding the following line in the `app/AppKernel.php`
226+
file of your project:
227+
228+
```php
229+
<?php
230+
// app/AppKernel.php
231+
232+
// ...
233+
234+
public function registerBundles()
235+
{
236+
$bundles = array(
237+
// ...
238+
return new <vendor>\<bundle-name>\<bundle-long-name>(),
239+
);
240+
}
241+
```
242+
243+
This template assumes that your bundle is in its ``1.x`` version. If not, change
244+
the ``"~1"`` installation version accordingly (``"~2"``, ``"~3"``, etc.)
245+
246+
Optionally, you can add more installation steps (*Step 3*, *Step 4*, etc.) to
247+
explain other required installation tasks, such as registering routes or
248+
dumping assets.
249+
197250
Routing
198251
-------
199252

0 commit comments

Comments
 (0)