I'm trying to populate a dropdown/select tag in cakephp,fortunately I was able to populate it with the values coming from my database, however it displays ALL. How can I limit the population to a specific ID?
To make things clear here's what I want to achieve:
dropdown-contains only values that are associated with apples from the DB
Currently here's how it looks like
dropdown-contains all fruits values from the DB
Here's my current code tnx any help/suggestions is very much appreciated
$fruits = $this->Model1->Model2->find('list', array('fields' => array('id', 'fruit_name', //'conditions' => array(''=>'') ))); $this->set('fruitsList', $fruits);
echo $this->Form->input('Model1.salad_fruits_id', array('type' => 'select', 'options' => $fruitsList, ));