protected static function getAttributesString($attributes)
    {
        $str = '';
        if (is_array($attributes)) {
            $charset = self::getOption('charset');
            foreach ($attributes as $key => $value) {
                $str .= ' ' . $key . '="' . htmlspecialchars($value, ENT_QUOTES, $charset) . '"';
            }
        }
        return $str;
    }