public function init()
{
parent::init();
$classes = array('table');
if (isset($this->type)) {
if (is_string($this->type)) {
$this->type = explode(' ', $this->type);
}
$validTypes = array(self::TYPE_STRIPED, self::TYPE_BORDERED, self::TYPE_CONDENSED);
if (!empty($this->type)) {
foreach ($this->type as $type) {
if (in_array($type, $validTypes)) {
$classes[] = 'table-' . $type;
}
}
}
}
if (!empty($classes)) {
$classes = implode(' ', $classes);
if (isset($this->htmlOptions['class'])) {
$this->htmlOptions['class'] .= ' ' . $classes;
} else {
$this->htmlOptions['class'] = $classes;
}
}
}