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 > 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: 'lo

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, $us

Re: Quick way to wrap input[type=radio] in label tags?

2013-06-18 Thread
I think very quick and dirty way is to override radio() method of FormHelper. http://book.cakephp.org/2.0/en/views/helpers.html#using-and-configuring-helpers Follow above, create MyFormHelper(or your preferring name), override radio() method, and do preg_replace() to the result of parent method. R

Re: Find 'All' returns same record multiple times

2013-02-10 Thread
Perhaps you can't get hasMany records(Characters) at once with `join` option. Use bindModel() etc. See: http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly 2013/2/11 清水紘己 > You should specify event_id or so t

Re: Find 'All' returns same record multiple times

2013-02-10 Thread
You should specify event_id or so to `group` option for GROUP BY when using joins with multiple records. It is SQL matter. 2013/2/11 Michael Gaiser > I want to know what I can do so it only returns the event once. Thanks. > > > So here is my find parameters. > > $this->Event->find('all', array(

Re: Users can only edit or delete themselves

2012-01-14 Thread
You may need to see: http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I hope Controller::isAuthorized() and Post::isOwnedBy() in the article is your purpose. 2012/1/15 J. : > But I want admins to be able to edit/delete any user too, is that > possible ? > > On 14 j

Re: Is it possible to turn off transactions in saveAll() ?

2012-01-11 Thread
see atomic option for saveAll() 2012/1/11 Patrick : > Hi, I'm new to cakephp and I want to know more about transactions in > saveAll(). > This is my script: > > > ... > > $this->BranchRequest->query('SET AUTOCOMMIT = OFF'); > $this->BranchRequest->begin(); > > if(!$this->Count->save($this->count_

Re: FormHelper::input() overwrite causes memory exhausted

2012-01-08 Thread
inputs() internally uses input() so infinite loop was caused. 2012/1/9 func0der : > Hey guys, > > just tried to create a Translation helper in cakephp 2.0. > > So i created  a TranslationHelper which extends the FormHelper. I > created a public function named "input" which obviously overwrites the

Re: cakephp 2.0.4: How to use Session Component in Plugin Components?

2012-01-03 Thread
You should make the component extend 'Component' class. 2012/1/3 Salines : > http://bin.cakephp.org/view/1662957875 > > -- > 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 t

Re: Cake 1.3 and localization of time and date

2012-01-02 Thread
You need to see following section of the manual with "LC_TIME" keyword: http://book.cakephp.org/2.0/en/appendices/new-features-in-cakephp-1-3.html?highlight=lc_time The Book seems to be unkind for it, TimeHelper, not appendices, document should have detail information I think! 2012/1/3 MetZ : > Hi

Re: How access to $this->webroot controller's variable from a model?

2012-01-02 Thread
>Laerte M. Rodrigues You meant Router::url(), right? It will return proper value through web, but not in cli at edge cases. Recommended way is manually to use Model::set() method or receive value via property, like $Post->webroot = $this->webroot(or Post::$webroot = ...). Because testing it is har

Re: Cake is NOT able to connect to the database.

2011-12-31 Thread
My last guess is pdo mysql is not enabled. 2012/1/1 Renato de Freitas Freire : > I had the same problem when start using cake 2.0.4 on my work, but I tried > it on my pc and it work fine. > > It might be something with your server configuration. > > I will doble check it on monday on my work. > An

Re: Cake is NOT able to connect to the database.

2011-12-31 Thread
Did you have done GRANT it? 2012/1/1 Ronghua : > I also tried my root login configuration, but it doesn't work as well. > > On 1月1日, 上午1时51分, "Timothy O'Reilly" > wrote: >> I'm sure you have tried it, but have you tried Login "Root" and Password >> "Root"? >> Regards, >> Tim >> >> >> >> >> >> >>

Re: Problem with relations

2011-12-27 Thread
I see Missing`Action`Exception at your errors :) 2011/12/28 jmail : > Hi! > > I've got question > > how can I make HABTM relation? > > I've got table shops with pk id column > I've got table couriers with pk id column > I've got table shops_couriers with pk id column and with shop_id and > courier