I have a custom field called time which has the below coding.
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
class JFormFieldTime extends JFormFieldList{
protected $type = 'time';
public function getOptions($id='') {
//Do the process and return
return $options;
}
}
The above works perfect at back-end because I have XML forms for each views.
My question now is how to show the field in the front-end where I don't have XML forms because of custom designs.
I tried the below in my edit.php (front-end)
require_once JPATH_LIBRARIES.'/mylib/fields/time.php';
$timefield = JFormHelper::loadFieldType('time', false);
$timeslots=$timefield->getOptions();
The above code gives all the options. Is there a simple way to convert this to a select list box. I know the hard way is to loop through and form the select box. Just want to know is there any simpler way like JHTML::...