开发者

Cakephp name column override [duplicate]

开发者 https://www.devze.com 2023-03-24 07:35 出处:网络
This question already exists: Closed 11 years ago. Possible Duplicate: List view for belongs to relation in cake
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

精彩评论

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