public function setAttribute(
            string $name, 
            $value = '', 
            bool $replaceIfExists = false, 
            $condition = true)
    {
        $name = trim(Text::toLower($name));
        if ($condition) {
            if (!preg_match('/^[a-z0-9_-]+$/', $name)) {
                Checkers::notice('Attribute name [' . $name . '] syntax error.');
            } else if ($name === 'class') {
                $this->addCssClass($value);
            } else if ($name === 'style') {
                $this->appendStyle($value);
            } else if (!$replaceIfExists && array_key_exists($name, $this->attributes)) {
                Checkers::notice('Attribute [' . $name . '] already exists.');
            } else {
                $value = $value !== null ? (string) str_replace('"', '\"', (string) $value) : null;
                $this->attributes[$name] = $value;
            }
        }
        return $this;
    }