Help calculated field in model

2013-07-02 Thread frocco
Hello, I have 4 price fields in my model. price1 price2 price3 price4 I only want to return a field called price for any queries. price will be one of the 4 price fields based on a condition. if userlevel is 'A' return price1 if userlevel is 'B' return price2 How can I do this in cakephp?

Re: problem with virtual fieds cakephp2

2013-07-02 Thread frocco
It is just a standard model that has 4 price fields. When a query is performed, I want to return one of those fields as price, not price1 .. 4 I have a user field called pricelevel that I will check. On Friday, June 28, 2013 2:41:55 AM UTC-4, Dakota wrote: We might be able to help you if

CakePHP - Empty $this-request-data array after Ajax POST

2013-07-02 Thread Juraj Vlk
I'm trying to save data which comes from Ajax POST request in JSON but There is empty $this-request-data in controller. My Ajax call: $.ajax({ type: POST, url: 'localhost/pages/register', dataType: 'json', data: pass_data, }); I use Cakephp 2.3. and JQuery 1.7 Do you have

Re: problem with virtual fieds cakephp2

2013-07-02 Thread euromark
Why the duplicate post https://groups.google.com/forum/#!topic/cake-php/sHON-jgTeLM ? Am Dienstag, 2. Juli 2013 15:49:57 UTC+2 schrieb frocco: It is just a standard model that has 4 price fields. When a query is performed, I want to return one of those fields as price, not price1 .. 4 I

Re: Help calculated field in model

2013-07-02 Thread 清水紘己
1. use virtualFields 2. modify results in afterFind() Callback 3. create Helper and its method 4. use Entity(plugin) and define price() method(or magic property) I will perhaps choose 3 or 4 because assumed that the user for calculation is on the context of actions. e.g. function price($item,

Re: CakePHP - Empty $this-request-data array after Ajax POST

2013-07-02 Thread Gaurav Matta
http://itfeast.blogspot.in/2013/06/cakephp-send-multiple-elements-in-ajax.html?m=1 Follow above link might help you or see jshelper for this version of cake On 02-Jul-2013 7:56 PM, Juraj Vlk jua...@gmail.com wrote: I'm trying to save data which comes from Ajax POST request in JSON but There is

Re: CakePHP - Empty $this-request-data array after Ajax POST

2013-07-02 Thread 清水紘己
using $(form).serialize() for data works fine. alternative way is $.param(pass_data) 2013/7/2 Juraj Vlk jua...@gmail.com I'm trying to save data which comes from Ajax POST request in JSON but There is empty $this-request-data in controller. My Ajax call: $.ajax({ type: POST,

Re: 301 infinite redirect

2013-07-02 Thread floydbrush
Hi AD, after one complete day of debug/experiment without success, I noticed that attribute Age: 0 appears at the second Server Response of the loop. Searching for the specification of the Age header field, I suspect the presence of the header field Age: 0 maybe means that the response is sent