How to bake controller with custom action?

From ControllerTask

->addOption('actions', [
                'help' => 'The comma separated list of actions to generate. ' .
                          'You can include custom methods provided by your template set here.'

how to add actions when bake controller, example

`bin/cake bake controller users add, edit, index, login, logout, forgetPassword, resetPassword` 


You can not do it. Bake is for add, edint, view and index. You should implement all oter actions yourself.


The bake action is, like most things in Cake, extensible by providing your own overrides, so if you have common functions you want to have it create for you, it’s possible to add them. But if you just want things added as one-offs (as most custom functionality tends to be), then rrd is right, just add them directly to the controller yourself.

1 Like