How can I activate Suffix without using --suffix? |
That one was added by me so I would answer.
PHP Code: /** As you can see, the $enabledSuffixing flag controls whether or not the option flag --suffix makes any effect when passed to the spark call. This flag is enabled by default. Why I did this? Because of the original refactor of the Generator, no matter what I do the component suffix is always attaching to the name of the output. So I need a way that developers could control whether the `--suffix` flag has any effect. Changing the logic to your proposal would be a deviation from the original intent of $enabledSuffixing. That means to say, that line is not the right line to solve your use case. I propose this. 1. Add a protected method to the GeneratorTrait: PHP Code: protected function getSuffixedName(string $class, string $component): string 2. These lines (https://github.com/codeigniter4/CodeIgni...#L211-L214) get changed to: PHP Code: $class = $this->getSuffixedName($class, $component); 3. In your own generator class, override the `getSuffixedName()` method: PHP Code: protected function getSuffixedName(string $class, string $component): string |
Messages In This Thread |
How can I activate Suffix without using --suffix? - by datamweb - 05-11-2022, 12:32 AM
RE: How can I activate Suffix without using --suffix? - by kenjis - 05-11-2022, 12:51 AM
RE: How can I activate Suffix without using --suffix? - by datamweb - 05-11-2022, 01:08 AM
RE: How can I activate Suffix without using --suffix? - by kenjis - 05-11-2022, 01:17 AM
RE: How can I activate Suffix without using --suffix? - by datamweb - 05-11-2022, 08:58 PM
RE: How can I activate Suffix without using --suffix? - by paulbalandan - 05-17-2022, 08:31 AM
RE: How can I activate Suffix without using --suffix? - by datamweb - 05-19-2022, 01:55 AM
|