Closed that0n3guy closed 10 years ago
Since I was adding a hook. I decided to add a couple others (I didnt test them yet). These would take care of #26 .
I think its better to do something like this:
// Create
public function beforeCreate($input);
public function creating($input);
public function afterCreate($model);
// Update
public function beforeUpdate($input);
public function updating($input);
public function afterUpdate($model);
// Delete
public function beforeDelete($model);
public function deleting($model);
public function afterDelete($model);
When you return a response in the after...
methods (e.g. a redirect). That response object will be used instead of the one in the controller.
I needed this hook for some wizardry I was doing with mongodb and embedded documents.
Thought it might be usefull for others... needs documented thought (just like create/update needs documented).