function add() {
if (!empty($this->data)) {
$this->data['Model']['amount_plus_fee'] = $this->data['Model']['amount'] + 10;
$this->Model->save($this->data);
}
}
So amount_plus_fee wouldn't be in the form necessarily, but it's a field on the table that you save here.
On Friday, March 2, 2012 10:46:50 AM UTC-8, Graham wrote:
-- On Friday, March 2, 2012 10:46:50 AM UTC-8, Graham wrote:
Hi, I am extremely new to CakePHP and I have a requirement that I
cannot see how to resolve.
I have been through the tutorials and searched the web for a solution
but cannot find an answer. It might be that I am not searching for the
right thing - I hope someone can point me in the right direction.
I can add a new record into a database from a form without problem. I
would like to add data to a database field that I generate based on
some other information - not from the form. The data will be based
upon some values from the form plus a sequence number.
I guess I could do it in an extra write but that is wasteful on
resources. I would like to add the extra data in the same statement as
the data form the form if that is possible.
This is sounding more complicated as I write it down but I hope
someone can decypher my needs!!
Thanks in advance for your assistance.
Graham
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment