accessing controller variables in model CakePHP -


i have 2 variables in controller in cakephp accessed using

$this->data['general']['q']  $this->data['general']['typesearch']. 

how refer these variables in model???

you didn't specify why need variables in model. because context important kind of questions, it's hard accurately answer 1 without it.

well, try defining variables in model first:

class mymodel extends appmodel {     var $q;     var $typesearch; } 

then, in controller try pass values of controller variables variables:

$this->mymodel->q = $this->data['general']['q']; $this->mymodel->typesearch = $this->data['general']['typesearch']; 

regards, hiawatha


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -