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 guran.banga...@gmail.com

 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 field3.Hidden is the 'total' field. The user enters
 numerical values in field1, field2, and field3. Before the data is
 saved into the database field1 needs to be multiplied with 0.55 and
 saved back in field1. Then the 3 fields need to be added and saved in
 the hidden field 'total'.

 I am looking for an access point to get to the fields and do my
 computation before they are saved into the database. Any suggestions
 and help is appreciated.

 ...guran

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Mirko Coz Berrospi
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


$form- create with $useTable (CakePHP 1.2)

2007-05-31 Thread Mirko

In my model i have:
  var $useTable = 'proizvodi';
  // The model can't be pluralized with english

But when I do:
  $form-create('Proizvod', array('action' = 'dodaj'));
  // Proizvod = Product, dodaj = add

The output is:
  form id=ProizvodAddForm method=post action=/admin/proizvods/
dodaj/

And I want my action to be /admin/proizvodi/dodaj

Setting
  $form-create('Proizvod', array('url' = 'dodaj'));
  // 'url' instead of 'action' makes it right.

Is this the way it should be?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Suppressing the label in form-select

2007-05-31 Thread Mirko

FormHelper::select() doesn't issue a label tag, just the select tag.

Yes, and not even surrounding div, but why???


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Paginator and custom routes problem (latest 1.2 alpha)

2007-05-30 Thread Mirko

I have exactly the same problem.
All I get is a link with nothing but controller name in it: a href=/
products/

Greets, Mirko


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---