Skip to content

Commit a12263b

Browse files
committed
applied code review suggestion
1 parent 756d51b commit a12263b

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

user_guide_src/source/cli/cli_generators.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,15 @@ GeneratorTrait
309309
All generator commands must use the ``GeneratorTrait`` to fully utilize its methods that are used in code
310310
generation.
311311

312-
*************************************
313-
Accessing a Custom Generator Template
314-
*************************************
312+
*************************************************************
313+
Declaring the Location of a Custom Generator Command Template
314+
*************************************************************
315315

316-
By default, all generator templates will be looked up at the ``CodeIgniter\Commands\Generators\Views`` namespace.
317-
To declare a custom location for your custom generator template, you will need to add it to the ``app/Config/Generators.php``
316+
The default order of lookup for generator templates is first, the template defined in the **app/Config/Generators.php** file,
317+
and if not found, the template will be looked up at the ``CodeIgniter\Commands\Generators\Views`` namespace.
318+
319+
To declare the template location for your custom generator command, you will need to add it to the **app/Config/Generators.php**
318320
file. For example, if you have a command ``make:awesome-command`` and your generator template is located within your *app*
319-
directory ``app/Commands/Generators/Views/awesomecommand.tpl.php``, you would update the config file like so:
321+
directory **app/Commands/Generators/Views/awesomecommand.tpl.php**, you would update the config file like so:
320322

321323
.. literalinclude:: cli_generators/001.php

user_guide_src/source/cli/cli_generators/001.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ class Generators extends BaseConfig
88
{
99
public array $views = [
1010
// ..
11-
'make:awesome-command' => 'App\Commands\Generators\awesomecommand.tpl.php',
11+
'make:awesome-command' => 'App\Commands\Generators\Views\awesomecommand.tpl.php',
1212
];
1313
}

0 commit comments

Comments
 (0)