by Anonymous » 25 Feb 2025, 07:54
Wie erstelle ich eine Dropdown -Liste mit benutzerdefiniertem Element in Joomla 3.1? Ich habe mir ein paar Beispiele angesehen, aber ich bekomme das Ding nicht zum Laufen. Ich habe Folgendes ausprobiert, aber die Liste ist nicht genariert. Die HTML funktioniert nicht. < /P>
Code: Select all
public function getInput() {
$jinput = JFactory::getApplication()->input;
$sub_id = $jinput->get('sub_id');
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('*')
->from('#__unis_faculties')
->order('faculty_name');
$db->setQuery($query);
$rows = $db->loadObjectList();
//array_unshift($rows, JHtml::_('select.option', '', JText::_('COM_UNIS_FACULTIES'), 'value', 'text'));
return JHTML::_('select.genericlist',$rows,'faculties',array('class'=>'nourritures','option.attr'=>'data'));
}
Wie erstelle ich eine Dropdown -Liste mit benutzerdefiniertem Element in Joomla 3.1? Ich habe mir ein paar Beispiele angesehen, aber ich bekomme das Ding nicht zum Laufen. Ich habe Folgendes ausprobiert, aber die Liste ist nicht genariert. Die HTML funktioniert nicht. < /P>
[code]public function getInput() {
$jinput = JFactory::getApplication()->input;
$sub_id = $jinput->get('sub_id');
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select('*')
->from('#__unis_faculties')
->order('faculty_name');
$db->setQuery($query);
$rows = $db->loadObjectList();
//array_unshift($rows, JHtml::_('select.option', '', JText::_('COM_UNIS_FACULTIES'), 'value', 'text'));
return JHTML::_('select.genericlist',$rows,'faculties',array('class'=>'nourritures','option.attr'=>'data'));
}
[/code]