Although the code above works, this code provides more useful options.
Step 1: Create a Plugin
cake baking plugin PluginNameInCamelCase
Step 2: Create a Model
cake baking plugin --PluginNameInCamelCase`
It will show a list of available models, select which you want to bake as a user model, news model, etc.
Step 3: Create a Controller
baking controller plugin - PluginNameInCamelCase
It will show a list of available controllers, select which you want to bake as a user controller, news controller, etc.
Step 4: create final review files for your plugin
cake baking plugin --PluginNameInCamelCase
It will show a list of available controllers for which you want to make viewing files, select and do!
More details
source share