Hello. I want to use a query result as the options of a select form. However, i am quite lost on how to achieve that purpose. Here's my current code :
$acc = new Select('account', AccountHistory::find(), array(
'using' => array('accID', 'accName-accNumber-bank'),
'useEmpty' => true,
'emptyText' => '...',
'emptyValue' => '0'
));
$acc->setLabel('Select your account');
$this->add($acc);
And here's the AccountHistory model :
class AccountHistory extends Model{
public $accID;
public $userID;
public $bank;
public $accNumber;
public $accName;
public function initialize(){
$this->skipAttributes(array('accID'));
}
}
The desired select option is something like this : 'Steve-1234567890-Commonwealth Bank'.
Thanks in advance :D