In my ModuleEditForm.php I create a select by initializing a new Zend Table
object like below. My problem is I need to narrow down my
getModuleSelectData result by a given module_id. Is there an easy way to do
this I've tried creating setters and getters for both objects to pass the
module_id in some way but the objects never hold the data. I'm not even sure
a Zend Form object allows you to pass properties like so.  Is creating the
Zend Table object inside my Zend Form class the best route for populating my
select statement? Thanks for your help.

 

$module = new Module();

 

$module_list = $module->getModuleSelectData();

 

$module_select = $this->createElement('select', 'module');

$module_select->setLabel('Select module:')

            ->setAttrib('class','quick-btn')

            ->setAttrib('style','margin:5px; 0 5px 0;')

            ->addMultiOptions($module_list)

            ->setRequired(false);

 

In my Zend Table method I query the available data.

 

public function getModuleSelectData()

{

      $select = $this->_db->select()

            ->from($this->_name, array('key' => 'module_id', 'value' =>
'module_title'));

      $result = $this->getAdapter()->fetchAll($select);

      return $result;

}

 

Thomas Shaw

tmsms...@tx.rr.com

 

Reply via email to