You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bake could be expanded to include behavior for other core plugins. We could enable this behavior in a generic way so that users could use it in any custom templates they may have.
Controller base - actions with plugin logic
When you're using the authorization plugin, all of your controller actions will require a call to authorize(). That is a perfect task for bake to take care of. For example, controller actions could have a block like:
{% if Bake.hasPlugin('Authorization') %}
$this->Authorize->authorize(${{ singularVar }});
{% endif %}
This would allow plugins to have deeper integration with bake and get people further faster.
We can also use this to generate a simple login form, and beforeFilter method on a UsersController if the Authentication plugin is present. While I would like to be able to modify the Application methods as well, we would need bake to be able to parse and manipulate files. This feels similar to what rector does, but I'm not sure rector was intended to be used this way.
Model bake - Add plugin behaviors
We could also explore giving plugins ways to hook into table generation. For example plugins could receive the table, inspect schema and add additional behaviors. An example usecase would be a Sluggable behavior being added to models with slug in their schema.
The text was updated successfully, but these errors were encountered:
Description
Bake could be expanded to include behavior for other core plugins. We could enable this behavior in a generic way so that users could use it in any custom templates they may have.
Controller base - actions with plugin logic
When you're using the
authorization
plugin, all of your controller actions will require a call toauthorize()
. That is a perfect task for bake to take care of. For example, controller actions could have a block like:This would allow plugins to have deeper integration with bake and get people further faster.
We can also use this to generate a simple login form, and
beforeFilter
method on aUsersController
if the Authentication plugin is present. While I would like to be able to modify theApplication
methods as well, we would need bake to be able to parse and manipulate files. This feels similar to what rector does, but I'm not sure rector was intended to be used this way.Model bake - Add plugin behaviors
We could also explore giving plugins ways to hook into table generation. For example plugins could receive the table, inspect schema and add additional behaviors. An example usecase would be a Sluggable behavior being added to models with
slug
in their schema.The text was updated successfully, but these errors were encountered: