Welcome Guest, Not a member yet? Register   Sign In
How to set the namespace in the CLI Command (programmatically)?
#1

Hello everyone. My task is to create a spark command that will create a special controller for the module. The essence of the command will be simple, I specify the name of the module, and spark creates a controller in the Controllers directory of this module. An example command would look like this: 
Code:
php spark mycommand <MyModuleName>
The question is how to programmatically set the namespace inside the command handler using standard methods to get the desired namespace of the form Modules\MyModuleName\Controllers in created controller
Reply
#2

spark make:controller command has --namespace option.
See the source code how to handle the namespace.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB