Controller Generator
generate your MVC actions
controller-generator
Generate your sample Laminas MVC Controller for given module, namespace and name. You can pass options as actions to generate a list of available actions.
On-line Generator
Setup Instructions
- Ensure you have module called: %module% in your application.
- Create a PHP file called %name%Controller.php in: [root]/module/%module%/controllers/ and paste the contents from above.
- Optionally, copy the contents of "Config for controller" to the [root]/module/%module%/config/
Throubleshooting
Make sure your application contains all the required plugins from "Required Laminas Components" and "Required Laminas Kit Components".
You can learn how to add missing dependencies in this video:
You can learn how to add missing dependencies in this video:
Parameters
Param name | Type | Default value | Description |
---|---|---|---|
name | text | NULL | Sets a controller name |
module | text | NULL | Sets a module name |
actions | array | NULL | Sets controller's actions |
CLI Usage
"vendor/bin/laminas.bat" mvc:controller --actions=<action1> --actions=<action2> --module=<moduleName> <name>
Example Usage
"vendor/bin/laminas.bat" mvc:controller --actions=add --actions=update --actions=delete --module=Application Users