Skip to content

Commit 37af427

Browse files
Merge pull request #139 from cleverage/138
#138 - Document the Symfony Flex recipe
2 parents 4b3284c + a1c1551 commit 37af427

3 files changed

Lines changed: 31 additions & 6 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Latest
22
------
33

4+
## Changes
5+
* [#138](https://github.com/cleverage/ui-process-bundle/issues/138) Installation documentation: describe the Symfony Flex recipe, which registers the bundle, imports the bundle controllers routes (`config/routes/clever_age_ui_process.yaml`, the EasyAdmin routes being imported by the EasyAdmin recipe) and creates `config/packages/clever_age_ui_process.yaml`, and the manual setup without Flex.
6+
47
v3.3
58
------
69

‎docs/index.md‎

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ Open a command console, enter your project directory and install it using compos
5050
composer require cleverage/ui-process-bundle
5151
```
5252

53-
Remember to add the following line to `config/bundles.php` (not required if Symfony Flex is used)
53+
With [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), the
54+
[recipe](https://github.com/symfony/recipes-contrib/tree/main/cleverage/ui-process-bundle) registers the bundle,
55+
imports its routes (`config/routes/clever_age_ui_process.yaml`) and creates its configuration
56+
(`config/packages/clever_age_ui_process.yaml`, see [configuration](#configuration)). The recipes of its dependencies
57+
configure the security password hasher and the Doctrine naming strategy expected below: go straight to the
58+
[database](#database) step.
59+
60+
Without Flex, add the following line to `config/bundles.php`, then follow the quick setup:
5461

5562
```php
5663
CleverAge\UiProcessBundle\CleverAgeUiProcessBundle::class => ['all' => true],
@@ -61,12 +68,24 @@ CleverAge\UiProcessBundle\CleverAgeUiProcessBundle::class => ['all' => true],
6168
### Import routes
6269

6370
```yaml
64-
# config/routes.yaml
65-
ui-process-bundle:
71+
# config/routes/clever_age_ui_process.yaml
72+
clever_age_ui_process:
6673
resource: '@CleverAgeUiProcessBundle/config/routes/*.yaml'
6774
```
6875
69-
This imports the bundle controllers and the EasyAdmin routes (do not import `easyadmin.routes` a second time).
76+
This imports the bundle controllers and the EasyAdmin routes (do not import `easyadmin.routes` a second time). If
77+
EasyAdmin routes are already imported (e.g. `config/routes/easyadmin.yaml`, created by the EasyAdmin recipe), import
78+
only the controllers, as the recipe does:
79+
80+
```yaml
81+
# config/routes/clever_age_ui_process.yaml
82+
clever_age_ui_process:
83+
resource: '@CleverAgeUiProcessBundle/config/routes/controllers.yaml'
84+
```
85+
86+
The former route names, deprecated since 3.3, are then not defined: if your application still uses them, also import
87+
`@CleverAgeUiProcessBundle/config/routes/deprecated_aliases.yaml`.
88+
7089
See [routes](reference/03-users_and_security.md#routes).
7190

7291
### Security

‎docs/reference/03-users_and_security.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ the previous one. It is used to authenticate on the [HTTP API](06-http_api.md).
130130
Routes
131131
------
132132

133-
Routes are imported with `@CleverAgeUiProcessBundle/config/routes/*.yaml` (see [installation](../index.md#import-routes)).
133+
Routes are imported with `@CleverAgeUiProcessBundle/config/routes/*.yaml`, or
134+
`@CleverAgeUiProcessBundle/config/routes/controllers.yaml` when the EasyAdmin routes are already imported, as done by the
135+
Symfony Flex recipe (see [installation](../index.md#import-routes)).
134136

135137
| Route name | Former name (deprecated) | Path | Description |
136138
|-------------------------------------|--------------------------|----------------------------------|----------------------------------------------------------------------------------------------|
@@ -147,7 +149,8 @@ The routes of the CRUD pages are generated by EasyAdmin from the dashboard route
147149

148150
The former route names are deprecated aliases since 3.3 (`config/routes/deprecated_aliases.yaml`), removed in 4.0:
149151
generating a URL with them, or opening a `?routeName=<former name>` URL of the dashboard, still works and triggers a
150-
deprecation.
152+
deprecation. They are not defined when only `controllers.yaml` is imported (Symfony Flex recipe): import
153+
`deprecated_aliases.yaml` too if your application still uses them.
151154

152155
The EasyAdmin routes (the dashboard and its CRUD pages) are generated by the `easyadmin.routes` loader imported by
153156
`config/routes/easyadmin.yaml`. This loader generates the routes of **every** dashboard, including the ones of your

0 commit comments

Comments
 (0)