How to get an interactive console when baking a plugin in CakePHP?

147 views Asked by At

Using CakePHP 2.6.7

When baking a normal part of an application (e.g. using cake bake model) the console is interactive - it goes through the construction process asking for you to choose options at each stage.

But when using cake bake model MyModel --plugin MyPlugin to do the same for a plugin no options are displayed and it generates the model in the plugin folder using default settings.

Is there a way to make the generation of the individual parts of a plugin interactive in the same manner? (this goes for model/controller/view)

1

There are 1 answers

0
Kvothe On BEST ANSWER

When a model in a plugin is baked using cake bake model MyModel --plugin MyPlugin it uses scaffolding. To avoid this you have to use cake bake model --plugin MyPlugin and then the first option presented will allow you to choose from the possible models to be baked.

Replace model with controller/view as appropriate to bake those as well.