Here is an options callback that works for me in frontend (nothing to do with members though) Both are in a class PaypalkeyForm.php
Code:
$arrFields['product'] = array
(
'name' => 'product_'.$strFormId,
'label' => $GLOBALS['TL_LANG']['tl_paypalkey']['ppk_label_product'],
'inputType' => 'select',
'options_callback' => array('PaypalkeyForm', 'products_callback'),
'eval' => array('includeBlankOption'=>true, 'mandatory'=>true)//,
);
Code:
public function products_callback()
{
$arrRet = array();
//SELECT PRODUCTS
$qry = "SELECT * FROM tl_paypalkey_products";
$objRow = $this->Database->prepare($qry)->execute();
while ($objRow->next())
{
$arrRet[$objRow->id] = $objRow->select_name . ' [' . $objRow->amount . ']';
}
return $arrRet;
}
Bookmarks