0

I want to print out the programme_name in my programsubjects controller, but currently I have only the programme_code from the programmes controller.

How can I make my drop down list to bring the programme_name?

My code:

  $list[]=$this->ProgrammeChoice->Programme->ProgrammeRequirementsSubject->
  find('list',array('fields'=> array('programme_code'),
  'conditions'=>array(' ProgrammeRequirementsSubject.subject_code'=>$s_code,
  'compulsory'=>'true'),
   'group' =>array('programme_code')));

Now my programme_code is a primary key for the programme model, so how can I make it bring the programme_name while I have the programme_code?

4

1 回答 1

0

您可以使用 displayField 模型属性来指定要在 ddl 上显示为文本的字段(默认情况下,主键将是值)。食谱上有更多详细信息

于 2012-06-18T13:45:27.300 回答