I decided to add some extra data about the controllers and actions in some model beforeSave as follows:
//in the model
public function beforeSave() {
$this->data[$this->alias]['path'] = 'blah blan';
debug($this->params);
die(); //for debugging!
}
The printout of debug returns null! The model I uses is the Comment model of the comments plugin. I need to access params to get the current controller, actions and some url parameters.
Indeed, I plan to change the way that comments plugin lists the comments from model based to be path based to solve the issue of need comments for more than one action depend on the same model.
Finally I found the solution: It is in
Router
object methodgetParams()
;it prints out something like: