Re: Capturing Field information before to compute before saving in database

2010-01-20 Thread sphereweb
I think by cake standars.. keep your controller lean and model fat :) i will always remember this On Jan 19, 4:08 pm, Guran wrote: > I found the following code in the controller file: > > 1       function add() { > 2               if (!empty($this->data)) { > 3                       $this->Expens

Re: Capturing Field information before to compute before saving in database

2010-01-20 Thread sphereweb
I think by cake standars.. keep your controller lean and model fat :) i will always remember this On Jan 19, 4:08 pm, Guran wrote: > I found the following code in the controller file: > > 1       function add() { > 2               if (!empty($this->data)) { > 3                       $this->Expens

Re: Capturing Field information before to compute before saving in database

2010-01-19 Thread Guran
I found the following code in the controller file: 1 function add() { 2 if (!empty($this->data)) { 3 $this->Expense->create(); 4 if ($this->Expense->save($this->data)) { 5 $this->Session->setFlash(__('The

Re: Capturing Field information before to compute before saving in database

2010-01-19 Thread sphereweb
t; -Original Message- > From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf > > Of Guran > Sent: January-18-10 5:18 PM > To: CakePHP > Subject: Capturing Field information before to compute before saving in > database > > Thanks to all who

RE: Capturing Field information before to compute before saving in database

2010-01-18 Thread Dave
7;] + all your other fields return true; } Something like that Dave -Original Message- From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf Of Guran Sent: January-18-10 5:18 PM To: CakePHP Subject: Capturing Field information before to compute before savin

Re: Capturing Field information before to compute before saving in database

2010-01-18 Thread Mirko Coz
In the controller: $sum = 0; $this->data['Modelname']['field1'] *= 0.55 ; $this->data['Modelname']['hidden'] = $this->data['Modelname']['field1'] + $this->data['Modelname']['field2'] + $this->data['Modelname']['field3']; $this->Modelname->save($this->data) ; 2010/1/18 Guran > Thanks to all wh

Capturing Field information before to compute before saving in database

2010-01-18 Thread Guran
Thanks to all who have taken the time to help out without being condescending or intimidating. I am a newbee and this help has encouraged me to keep on learning CakePHP. Once I get good I will help others on this forum. Now on my expense submitter i am working on - there are field1, field2, and fi