nystudio107 / generator-craftplugin

generator-craftplugin is a Yeoman generator for Craft CMS plugins
MIT License
73 stars 30 forks source link

CLI: Generate files in subdirectories #80

Closed timeverts closed 4 years ago

timeverts commented 5 years ago

This is a feature request.

It would be great if it were possible to have the CLI generate template files in subdirectories.

For example, yo craftplugin --pluginComponents="services" --serviceName="foo/bar" would generate the service file at services/foo/Bar.php with the correct namespace of the subdirectory inserted as well. In the current implementation, this command generates the file services/Foobar.php, which is not what is desired.

If using / is too generic for indicating subdirectories, then alternatively \ could be used as the directory seperator instead.

khalwat commented 4 years ago

I don't think this type of path/namespace handling is going to be implemented, unless you wish to PR it in. That's always welcome!