Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/24.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
错误:joomla 2.5不支持500 JHtmlSelect::复选框列表_Joomla_Joomla2.5 - Fatal编程技术网

错误:joomla 2.5不支持500 JHtmlSelect::复选框列表

错误:joomla 2.5不支持500 JHtmlSelect::复选框列表,joomla,joomla2.5,Joomla,Joomla2.5,我在joomla 2.5中使用了这段代码 $booleanlist = JHTML::_('select.checkboxlist', '1', 'K2ExtraField[]', '', 'value', 'name',''); print $booleanlist; 但是当运行代码为get error select.checkboxlist不支持时,如何修复它Joomla中没有checkboxlist 但是从这个线索: 我发现这个代码: 在文件库/joomla/html/html/sele

我在joomla 2.5中使用了这段代码

$booleanlist = JHTML::_('select.checkboxlist', '1', 'K2ExtraField[]', '', 'value', 'name','');
print $booleanlist;

但是当运行代码为get error select.checkboxlist不支持时,如何修复它

Joomla中没有checkboxlist

但是从这个线索:

我发现这个代码:

在文件库/joomla/html/html/select.php中 添加代码:

/*custom checkbox*/
   function checkboxlist( $arr, $name, $attribs = null, $key = 'value', $text = 'text', $selected = null, $idtag = false, $translate = false )
   {
      reset( $arr );
      $html = '';

      if (is_array($attribs)) {
         $attribs = JArrayHelper::toString($attribs);
       }

      $id_text = $name;
      if ( $idtag ) {
         $id_text = $idtag;
      }

      for ($i=0, $n=count( $arr ); $i < $n; $i++ )
      {
         $k   = $arr[$i]->$key;
         $t   = $translate ? JText::_( $arr[$i]->$text ) : $arr[$i]->$text;
         $id   = ( isset($arr[$i]->id) ? @$arr[$i]->id : null);

         $extra   = '';
         $extra   .= $id ? " id=\"" . $arr[$i]->id . "\"" : '';
         if (is_array( $selected ))
         {
            foreach ($selected as $val)
            {
               $k2 = is_object( $val ) ? $val->$key : $val;
               if ($k == $k2)
               {
                  $extra .= " selected=\"selected\"";
                  break;
               }
            }
         } else {
            $extra .= ((string)$k == (string)$selected ? " checked=\"checked\"" : '');
         }
         $html .= "\n\t<input type=\"checkbox\" name=\"$name\" id=\"$id_text$k\" value=\"".$k."\"$extra $attribs />";
         $html .= "\n\t<label for=\"$id_text$k\">$t</label><br>";
      }
      $html .= "\n";
      return $html;
   }
/*end custom checkbox*/