public function makeComponent(array $attributes = [], string $innerHTML = '', string $tagName = 'component')
    {
        if (self::$newComponentCache === null) {
            self::$newComponentCache = new \IvoPetkov\HTMLServerComponent();
        }
        $component = clone(self::$newComponentCache);
        foreach ($attributes as $name => $value) {
            $component->setAttribute($name, $value);
        }
        $component->innerHTML = $innerHTML;
        $component->tagName = $tagName;
        return $component;
    }
public function makeComponent(array $attributes = [], string $innerHTML = '', string $tagName = 'component')
    {
        if (self::$newComponentCache === null) {
            self::$newComponentCache = new \IvoPetkov\HTMLServerComponent();
        }
        $component = clone(self::$newComponentCache);
        foreach ($attributes as $name => $value) {
            $component->setAttribute($name, $value);
        }
        $component->innerHTML = $innerHTML;
        $component->tagName = $tagName;
        return $component;
    }
public function makeComponent ( array $ attributes = [ ] , string $ innerHTML = '' , string $ tagName = 'component' ) { if ( self :: $ newComponentCache === null ) { self :: $ newComponentCache = new \ IvoPetkov \ HTMLServerComponent ( ) ; } $ component = clone ( self :: $ newComponentCache ) ; foreach ( $ attributes as $ name => $ value ) { $ component -> setAttribute ( $ name , $ value ) ; } $ component -> innerHTML = $ innerHTML ; $ component -> tagName = $ tagName ; return $ component ; }
Constructs a component object.

@param array $attributes The attributes of the component object.
@param string $innerHTML The innerHTML of the component object.
@param string $tagName The tag name of the component object.
@return \IvoPetkov\HTMLServerComponent A component object.
Constructs a component object .