25.06.2013, 13:39
Hallo leute
ich kapier gereade nicht wieso das nicht funktioniert:
ich habe eine Methode und bei der Frag ich hab, was ich gerade ausgewählt habe (von 3 Variablen) und gebe diese Variable auch weiter.
Nur Leider ändert er die einstellungen nicht so wie ich es will :/
ich kapier gereade nicht wieso das nicht funktioniert:
ich habe eine Methode und bei der Frag ich hab, was ich gerade ausgewählt habe (von 3 Variablen) und gebe diese Variable auch weiter.
Nur Leider ändert er die einstellungen nicht so wie ich es will :/
Code:
protected $thead = array();
protected $tfoot = array();
protected $tbody_array = array();
protected $current_section;
public function addSection($section, $class = '', $attributes = array() ) {
switch ($section) {
case 'thead':
$this->current_section = 'thead';
break;
case 'tfoot':
$this->current_section = 'tfoot';
break;
default: // tbody
$this->tbody_array[] = array();
$this->current_section = count($this->tbody_array)-1;
}
$ref = &$this->getCurrentSection();
if(!empty($class))
$attributes['class'] = $class;
$ref['attr'] = $attributes;
$ref['rows'] = array();
}
protected function getCurrentSection() {
if($this->current_section == 'thead') {
return $this->thead;
} elseif($this->current_section == 'tfoot') {
return $this->tfoot;
} else {
return $this->tbody_array[$this->current_section];
}
}
leider macht er nach print_r keine Ausgabe :/
Falls jemand frägt wieso in einer Extra Methode: ich brauche die Abfrage später noch mehrmals
Gruß Sysix