开发者

Cakephp name column override [duplicate]

This question already exists: Closed 11 years ago.

Possible Duplicate:

List view for belongs to relation in cake

I have table tha开发者_StackOverflowt has hasMany and belongTo relations. So users table belongs to communes and communes has many users.

Users table has commune_id column and I believe as per cake default you need to have 'name' column in communes table however if you do not want to change this to name. How do you override this and define another column name to act as name so it automatically generates dropdown box in the Users view?


i always thought this is one of the best documented parts of the cookbook. I can only wonder...

$this->displayField = 'your_custom_name';

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜