我的控制器。
$times=$this->Time->find('list',array('fields'=>$this->Time->virtualFields['name_price'] ));
$this->set('time',compact($times));
我下面加线在我的模型时间
public $virtualFields = array('name_price' => 'concat(Time.varaddress1, "-", Time.varaddress2)');
我CTP文件如下
<?echo $this->Form->input('intaddressid', array(
'options' => $time,'label'=>false,'empty' => '(Select Information)'
,'class' => 'form-control border_none'
));?>
但现在在输出我没有什么选择中提起。!
当我回声$时候我得到了'阵列()
我想在选择字段
<option>varaddress1,varaddress2</option>