Good morning, trying to create a dynamic select values for the database, but you can add a foreach this select?
$table = new Application_Model_DbTable_Artista();
$nombre = array();
foreach ($table->listar() as $c)
{
$id = $c->id;
$nombre[$id] = $c->nombre;
}
$this->addElement('select','artista_id',
array(
'value' => 'white',
'multiOptions' => array($nombre
),
'decorators' => array('ViewHelper', 'Errors'),
)
);