Re: Great Job on The Cookbook
blue colors might look good to some people but blue is a very exhausting color for the human eye. The receptors for blue color are the smallest group in the human eye and tehrefore looking at blue backgrounds and colors is exhausting. Not the way to go for a "book". On 3 Feb., 07:50, andy_the ultimate baker wrote: > no maharj > i m not happy with new cake book, > the tree structure in manual was very easy to access. > its very dull look to > > On Feb 3, 11:30 am, "Dave Maharaj" wrote: > > > > > > > > > Nice new look to the cookbook! I think it looks 100% more professional! > > > Great job to all who made it possible. > > > Dave -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Model debugging
Type: die(debug($variable)); ...in your model, and it will stop processing and print $variable to screen. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 3 Feb 2011, at 08:35, Axel wrote: > Hello! > > Following a previous comment (http://groups.google.com/group/cake-php/ > browse_thread/thread/f8a2060c617c8fb6/5f50c5ee5ebed975? > hl=en#5f50c5ee5ebed975), I was starting to put the work on my data in > the models instead of the controllers. Unfortunately, I have no idea > how to debug what is inside of my model? How is it possible to know > if it is correct? (cake 1.3) > > My case is : > I'm building a racing game > > I have CHAMPs (championship) hasMany TEAMs hasMany DRIVER > I have also CHAMP hasMany RACE hasMany ORDER (race orders). > I've also TRACK HasMany RACE > I've also TEAM HasMany ORDER > > So I have a function CalcPackage which determines the package (which > is the value of the car of my team on a race). To calculate the > package I need the values of the car (TEAM) and the values of the > TRACK (in function of the track the car is better or not). The global > package is a weighted sum of the separate package of 5 elements. This > function is a function of TEAM model. > > When I create a new RACE, I want my program to calcPackage of > everyteam. > > So : > > Races_controller.php: > function add() { > (...) > > $race=$this->data; > > //Recovery of the list of the team that are part of the race > $this->loadModel('Team'); > $team_list=$this->Team->find('all', array('fields' => > array('id'), 'conditions' => array('champ_id' => $race['Race'] > ['champ_id']), 'recursive' => 0)); > > //Package calculkation for that race > $team_nb=count($team_list); > > for($i = 1; $i <= 5; $i++) >{ >$c_car='c_car'.$i; >$track_coeff[]=$race['Track'][$c_car]; >} > > for ($i=0;$i<$team_nb;$i++) >{ >$this->Team->calcPackage($track_coeff,$team_list[$i]['Team'] > ['id']); >} > (...) > } > > TEAM model : > > function calcPackage($track_coeff,$teamID) > { > >$team=$this->findById($teamID); >$pack=0; >for($i = 1; $i <= 5; $i++) > { > $p_car='p_car'.$i; > $pack+=$track_coeff[$i-1]*$team['Team'][$p_car]; > } > >$team['Team']['p_current']=$pack; >$this->save($team); >return $pack; > } > > > > > > The problem is that I don't know if this set up is ok, and I have a > bug in my model but I'm not able to see which one. What are the > debugging possibilities? > > Thank you a lot for your answers! > > -- > 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+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: how to set the for of date?
This may help. http://www.ninjacodermonkey.co.uk/2010/11/formatting-all-dates-in-cakephp/ -- Kind Regards Stephen @ NinjaCoderMonkey www.ninjacodermonkey.co.uk -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Model debugging
Hello! Following a previous comment (http://groups.google.com/group/cake-php/ browse_thread/thread/f8a2060c617c8fb6/5f50c5ee5ebed975? hl=en#5f50c5ee5ebed975), I was starting to put the work on my data in the models instead of the controllers. Unfortunately, I have no idea how to debug what is inside of my model? How is it possible to know if it is correct? (cake 1.3) My case is : I'm building a racing game I have CHAMPs (championship) hasMany TEAMs hasMany DRIVER I have also CHAMP hasMany RACE hasMany ORDER (race orders). I've also TRACK HasMany RACE I've also TEAM HasMany ORDER So I have a function CalcPackage which determines the package (which is the value of the car of my team on a race). To calculate the package I need the values of the car (TEAM) and the values of the TRACK (in function of the track the car is better or not). The global package is a weighted sum of the separate package of 5 elements. This function is a function of TEAM model. When I create a new RACE, I want my program to calcPackage of everyteam. So : Races_controller.php: function add() { (...) $race=$this->data; //Recovery of the list of the team that are part of the race $this->loadModel('Team'); $team_list=$this->Team->find('all', array('fields' => array('id'), 'conditions' => array('champ_id' => $race['Race'] ['champ_id']), 'recursive' => 0)); //Package calculkation for that race $team_nb=count($team_list); for($i = 1; $i <= 5; $i++) { $c_car='c_car'.$i; $track_coeff[]=$race['Track'][$c_car]; } for ($i=0;$i<$team_nb;$i++) { $this->Team->calcPackage($track_coeff,$team_list[$i]['Team'] ['id']); } (...) } TEAM model : function calcPackage($track_coeff,$teamID) { $team=$this->findById($teamID); $pack=0; for($i = 1; $i <= 5; $i++) { $p_car='p_car'.$i; $pack+=$track_coeff[$i-1]*$team['Team'][$p_car]; } $team['Team']['p_current']=$pack; $this->save($team); return $pack; } The problem is that I don't know if this set up is ok, and I have a bug in my model but I'm not able to see which one. What are the debugging possibilities? Thank you a lot for your answers! -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Cake loads FALSE values as "" (empty)
@ Miles J i'm masochist ;-D usually i try to strictly respect cake conventions. this is the first time i notice this behavior. cake always worked flawlessly with his "" empty false values On 2 Feb, 19:19, Miles J wrote: > Well, why are you even using 2.0? > > On Feb 2, 8:59 am, euromark wrote: > > > > > nope, tilen > > > its tinyint(1) !!! > > ideally unsigned (cant be negative anyway) > > thats what booleans are stored as > > > tinyint(2) is for "pseudo" enum fields or small integer values > > > On 2 Feb., 15:05, Tilen Majerle wrote: > > > > for values like this, cake uses in database tinyint(2) fieldtype, where 1 > > > means true and 0 means false (compatible with form helper) > > > -- > > > Lep pozdrav, Tilen Majerlehttp://majerle.eu > > > > 2011/2/2 Ernesto > > > > > Hello. > > > > > i noticed that Cake loads boolean values stored in DB as "" (empty > > > > value) instead of 0 (zero). > > > > > is that intended? > > > > is there a way to avoid this? > > > > > i'm using 2.0-dev > > > > > -- > > > > Our newest site for the community: CakePHP Video Tutorials > > > >http://tv.cakephp.org > > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp > > > > others with their CakePHP related questions. > > > > > To unsubscribe from this group, send email to > > > > cake-php+unsubscr...@googlegroups.com > > > om>For more options, visit this group at > > > >http://groups.google.com/group/cake-php -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php