public function addClass(array $options = [], $class = null, $key = 'class') {
        if (!is_array($class)) {
            $class = explode(' ', trim($class));
        }
        $optClass = [];
        if (isset($options[$key])) {
            $optClass = $options[$key];
            if (!is_array($optClass)) {
                $optClass = explode(' ', trim($optClass));
            }
        }
        $class = array_merge($optClass, $class);
        $class = array_map('trim', $class);
        $class = array_unique($class);
        $class = array_filter($class);
        $options[$key] = implode(' ', $class);
        return $options;
    }