@@ -51,14 +51,14 @@ isolated context, but they can share common bundles, configuration, and code if
51
51
desired. The optimal approach will depend on your specific needs and
52
52
requirements, so it's up to you to decide which best suits your project.
53
53
54
- First, create a new ``applications `` directory at the root of your project, which will
54
+ First, create a new ``apps `` directory at the root of your project, which will
55
55
hold all the necessary applications. Each application will follow a simplified
56
56
directory structure like the one described in :ref: `Symfony Best Practice </best_practices >`:
57
57
58
58
.. code-block :: text
59
59
60
60
your-project/
61
- ├─ applications /
61
+ ├─ apps /
62
62
│ └─ api/
63
63
│ ├─ config/
64
64
│ │ ├─ bundles.php
@@ -77,7 +77,7 @@ directory structure like the one described in :ref:`Symfony Best Practice </best
77
77
78
78
Note that the ``config/ `` and ``src/ `` directories at the root of the
79
79
project will represent the shared context among all applications within the
80
- ``applications / `` directory. Therefore, you should carefully consider what is
80
+ ``apps / `` directory. Therefore, you should carefully consider what is
81
81
common and what should be placed in the specific application.
82
82
83
83
.. tip ::
@@ -86,7 +86,7 @@ directory structure like the one described in :ref:`Symfony Best Practice </best
86
86
``App `` to ``Shared ``, as it will make it easier to distinguish and provide
87
87
clearer meaning to this context.
88
88
89
- Since the new ``applications /api/src/ `` directory will host the PHP code related to the
89
+ Since the new ``apps /api/src/ `` directory will host the PHP code related to the
90
90
API, you have to update the ``composer.json `` file to include it in the autoload
91
91
section:
92
92
@@ -96,7 +96,7 @@ section:
96
96
"autoload" : {
97
97
"psr-4" : {
98
98
"Shared\\ " : " src/" ,
99
- "Api\\ " : " applications /api/src/"
99
+ "Api\\ " : " apps /api/src/"
100
100
}
101
101
}
102
102
}
@@ -135,7 +135,7 @@ resources::
135
135
136
136
public function getAppConfig
D7AE
Dir(): string
137
137
{
138
- return $this->getProjectDir().'/applications /'.$this->id.'/config';
138
+ return $this->getProjectDir().'/apps /'.$this->id.'/config';
139
139
}
140
140
141
141
public function registerBundles(): iterable
@@ -229,7 +229,7 @@ but it should typically be added to your web server configuration.
229
229
.. caution ::
230
230
231
231
The value of this variable must match the application directory within
232
- ``applications / `` as it is used in the Kernel to load the specific application
232
+ ``apps / `` as it is used in the Kernel to load the specific application
233
233
configuration.
234
234
235
235
Step 4) Update the Front Controllers
@@ -322,15 +322,15 @@ Let's consider that you need to create another app called ``admin``. If you
322
322
follow the :ref: `Symfony Best Practices </best_practices >`, the shared Kernel
323
323
templates will be located in the ``templates/ `` directory at the project's root.
324
324
For admin-specific templates, you can create a new directory
325
- ``applications /admin/templates/ `` which you will need to manually configure under the
325
+ ``apps /admin/templates/ `` which you will need to manually configure under the
326
326
Admin application:
327
327
328
328
.. code-block :: yaml
329
329
330
- # applications /admin/config/packages/twig.yaml
330
+ # apps /admin/config/packages/twig.yaml
331
331
twig :
332
332
paths :
333
- ' %kernel.project_dir%/applications /admin/templates ' : Admin
333
+ ' %kernel.project_dir%/apps /admin/templates ' : Admin
334
334
335
335
Then, use this Twig namespace to reference any template within the Admin
336
336
application only, for example ``@Admin/form/fields.html.twig ``.
@@ -345,7 +345,7 @@ default. Within its parent class, ``KernelTestCase``, there is a method called
345
345
the application during tests. However, the current logic of this method doesn't
346
346
include the new application ID argument, so you need to update it::
347
347
348
- // applications /api/tests/ApiTestCase.php
348
+ // apps /api/tests/ApiTestCase.php
349
349
namespace Api\Tests;
350
350
351
351
use Shared\Kernel;
@@ -368,7 +368,7 @@ include the new application ID argument, so you need to update it::
368
368
This examples uses a hardcoded application ID value because the tests
369
369
extending this ``ApiTestCase `` class will focus solely on the ``api `` tests.
370
370
371
- Now, create a ``tests/ `` directory inside the ``applications /api/ `` application. Then,
371
+ Now, create a ``tests/ `` directory inside the ``apps /api/ `` application. Then,
372
372
update both the ``composer.json `` file and ``phpunit.xml `` configuration about
373
373
its existence:
374
374
@@ -378,7 +378,7 @@ its existence:
378
378
"autoload-dev" : {
379
379
"psr-4" : {
380
380
"Shared\\ Tests\\ " : " tests/" ,
381
- "Api\\ Tests\\ " : " applications /api/tests/"
381
+ "Api\\ Tests\\ " : " apps /api/tests/"
382
382
}
383
383
}
384
384
}
@@ -394,7 +394,7 @@ And, here is the update needed for the ``phpunit.xml`` file:
394
394
<directory >tests</directory >
395
395
</testsuite >
396
396
<testsuite name =" api" >
397
- <directory >applications /api/tests</directory >
397
+ <directory >apps /api/tests</directory >
398
398
</testsuite >
399
399
</testsuites >
400
400
@@ -408,7 +408,7 @@ you will have to repeat the step 1 only:
408
408
.. code-block :: text
409
409
410
410
your-project/
411
- ├─ applications /
411
+ ├─ apps /
412
412
│ ├─ admin/
413
413
│ │ ├─ config/
414
414
│ │ │ ├─ bundles.php
0 commit comments