fill drop down list from database in cakephp -


please idea fill combo list database ??

i want fill drop down list table database me.

in controller , model , view

if using cakephp. here example:

html (index.ctp):

<ul>   <?php foreach($data $mydata): ?>    <li><?php echo $mydata['modelname']['datacolunm']; ?>   <?php endforeach; ?> </ul> 

model:

class modelname extends appmodel{  } 

controller:

class controllername extends appcontroller{  public $uses = array('modelname');  //index.ctp public function index(){   $getdata = $this->modelname->find('all');   //you can add other query parameters     $this->set('data', $getdata);   // use "data" in view (index.ctp)  }  } 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -