Model Generator
generate your MVC full model object
model-generator
Generate your sample Laminas MVC Model for given module and name. You can pass a list of properties to generate a list of availble properties to fetch by and update methods.
On-line Generator
Setup Instructions
- Ensure you have module called: %module% in your application.
- Create PHP files called AbstractTable.php and %name%Model.php in: [root]/module/%module%/src/Model/ 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 model name |
module | text | NULL | Sets a module name |
properties | array | NULL | Sets model's properties |
CLI Usage
"vendor/bin/laminas.bat" mvc:model --properties=<action1> --properties=<action2> --module=<moduleName> <name>
Example Usage
"vendor/bin/laminas.bat" mvc:model --properties=add --properties=update --properties=delete --module=Application Users