Page 1 of 3
1 · 2 · 3

Daniel Hofstetter :: 26.06.2008 03:52:59
Just a detail, but the var $uses statement in the ArticlesController is not needed as Cake automatically loads the Article model.
lecterror :: 26.06.2008 04:43:13
Yes, but I figured it can't hurt either ;-)

Also, I remember the time when I didn't know that I can access the related model via $this->Article->Category, so what I used to do was:

var $uses = array('Article', 'Category');

I was so wrong... :-/

(In fact, I think this code is still running my site)
rafaelbandeira3 :: 03.09.2008 17:24:14
Actually you don't need to manually set your input options if you follow the var you passed to the view has the name equal to

Inflector::varName(Inflector::pluralize(preg_replace('/_id$/', '', $fieldName)))

wich means that, for Post.category_id you should have a "categories" var passed to the view, and for Employee.soccer_team_id you should have a "soccerTeams"

as shown in FormHelper's source line 607: http://api.cakephp.org/form_8php-source.html#l00607

BTW, I didn't like the fact that I can't post a comment while seeing other people comments, I can't cite them or use as reference... but that's my opinion of course...
lecterror :: 05.09.2008 09:24:12
Hi rafaelbandeira3,

thanks for the tip, that's a good one.

We'll see about the comments, it will probably be done in a future (but unspecified!:)) release of Neutrino.
kevin_smith :: 07.12.2008 17:57:43
Would you post this into the bakery? The only example I could find there is for 1.x and I wasted have a day before stumbling upon this.

Oh, and thanks.