php - Default variable that is passed to views -
very simple cakephp question.
i know can pass data $this->set()
in controller, , know data exists in $this->request->data
.
does cakephp pass request->data
named variable can called in view automatically? or, have $this->set('variable', 'data')
?
request data accessible automatically in view without need set variable:
$this->request->data(...
fore example (accessing post data):
$this->request->data['mymodel']['title'];
you can debug($this->request->data());
in view see what's available you.
Comments
Post a Comment