Closed sammyskills closed 1 year ago
It seems, not creating file me.tpl.php is intentional, this is because even if file me.tpl.php is generated, it should still be defined in app\Config\Generators.php anyway. Otherwise it is not useful.
The following link explains how to create a new command.
I'm not even bothered about automatically creating the view template, but locating it when it is added in the $this->template
variable.
If it must also be declared in the app/Config/Generators.php
file, then the documentation is either misleading or it doesn't contain enough explanations.
The documentation seems to be insufficient. https://codeigniter4.github.io/CodeIgniter4/cli/cli_generators.html
Which is better for the docs?
Creating Custom Generators
, ORCLI Generators
page.It seems adding a section to https://codeigniter4.github.io/CodeIgniter4/cli/cli_generators.html is fine.
Submitted a PR #7408
PHP Version
7.4
CodeIgniter4 Version
4.3.3
CodeIgniter4 Installation Method
Composer (using
codeigniter4/appstarter
)Which operating systems have you tested for this bug?
Windows
Which server did you use?
apache
Database
No response
What happened?
I created a generator command like so:
And updated the file like so:
I have the generator template in the directory:
app/Commands/Generators/Views/me.tpl.php
. But when I try to use the commandphp spark make:me-test
, I get the error message:Steps to Reproduce
php spark make:command TestCommandGenerator --type generator --command make:me-test
.app/Commands/Generators/Views
folder.run()
method of theTestCommandGenerator.php
to contain the name of the view template you created above:$this->template = ''; // name of file here
php spark make:me-test
.Expected Output
I expect that the view template file would be located within the
app
namespace instead ofCodeIgniter
.Anything else?
No response