Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 自定义组件中的joomla 3.1下拉列表_Html_Html Select_Joomla3.1 - Fatal编程技术网

Html 自定义组件中的joomla 3.1下拉列表

Html 自定义组件中的joomla 3.1下拉列表,html,html-select,joomla3.1,Html,Html Select,Joomla3.1,如何在joomla 3.1中为自定义组件创建下拉列表。我尝试创建自定义字段,并希望使用joomlas下拉菜单进行搜索 我的get输入法看起来 public function getInput() { $jinput = JFactory::getApplication()->input; $sub_id = $jinput->get('sub_id'); $db = JFactory::getDbo(); $qu

如何在joomla 3.1中为自定义组件创建下拉列表。我尝试创建自定义字段,并希望使用joomlas下拉菜单进行搜索

我的get输入法看起来

public function getInput() {


        $jinput = JFactory::getApplication()->input;

        $sub_id = $jinput->get('sub_id');

        $db = JFactory::getDbo();
        $query = $db->getQuery(true)
                ->select('*')
                ->from('#__unis_faculties')
                //->join('#__unis_subjects')    
                ->order('faculty_name');
        $db->setQuery($query);
        $rows = $db->loadObjectList();

        if (isset($sub_id)) {
            $actual = $db->getQuery(true)
                    ->select('f.id, f.faculty_name')
                    ->from('#__unis_faculties AS f')
                    ->join('LEFT', '#__unis_subjects AS s ON f.id = s.faculty')
                    ->where('f.id = ' . $sub_id);
            $db->setQuery($actual);
            $actual_row = $db->loadRow();
        }
        $html = '';

        $html .= '<div class="span12 input-prepend">
                    <span class="add-on">€ </span>
                    <input class="span4" name="price" id="price" type="text" />
                 </div>';

        $html .= '<field name="" type="list" default="" label="Select an option" description=""><select>';
        foreach ($rows as $row) {
            $html .= '<option ' . "selected" ? $row->id = $actual_row->id : '' . 'value="' . $row->id . '" >' . $row->faculty_name . '</option>';
        }
        $html .= '</select></field>';
        return $html;
    }
但这不会输出所需的结果,列表不会显示

实际代码生成以下下拉列表,但不显示元素

附加所需结果的屏幕截图或发布包含生成的html的JSFIDLE可能会帮助其他人。请尝试从$html中删除and