Nu krijg ik de volgende error:
on line 46 Warning: array_search() expects parameter 2 to be array, string given in
<?php
class CategoryselectorsTemplate extends ActiveTemplate {
public function getHtml($var) {
$html = '';
/* Alle attribute arrays setten */
$attributeids = array(
1 => 'fabrikant',
//3 => 'artikelnummer',
4 => 'geslacht',
//6 => 'maat',
7 => 'kleur',
8 => 'sexe',
);
foreach($attributeids AS $id => $keyname){
$values = WebshopModel::instance()->getAttributeValues($id, "", "15");
$stockvals = array();
foreach($values AS $val){ // Alle values bij langs
if(strlen($val) > 0){ // Zijn ze niet leeg?
$ex = explode(',',$val);
foreach($ex AS $name){
if(!in_array($name,$stockvals)){
array_push($stockvals,$name);
}
}
}
}
sort($stockvals);
if(count($stockvals) > 1){
$html .= '<aside class="widget widget_product_color">';
$html .= '<h3 class="widget-title">'.ucfirst($keyname).'</h3>';
$html .= '<ul>';
// Html Genereren
foreach($stockvals AS $val){
if (is_int(array_search($val,$keyname)) OR is_int(array_search($val,$keyname))) {
$add = '';
} else {
$add = '';
}
$html .= '<li><input type="checkbox" name="'.$keyname.'[]" value="'.$val.'" '.$add.'> '.$val.'</li>';
}
$html .= ' </ul></aside>';
}
}
return $html;
}
}
?>Doe ik nu iets verkeerds of ligt het aan de code?.