src/SellerLabs/Nucleus/View/Node.php
public function render()
    {
        $result = $this->spec->check($this->attributes);
        if ($result->failed()) {
            throw new InvalidAttributesException($result);
        }

        $attributes = $this->renderAttributes();
        if (strlen($attributes)) {
            $attributes = ' ' . $attributes;
        }

        if ($this->selfClosing) {
            return vsprintf(
                '<%s%s/>',
                [$this->tagName, $attributes]
            );
        }

        return vsprintf(
            '<%s%s>%s</%s>',
            [
                $this->tagName,
                $attributes,
                $this->renderContent(),
                $this->tagName,
            ]
        );
    }
public function render()
    {
        $result = $this->spec->check($this->attributes);
        if ($result->failed()) {
            throw new InvalidAttributesException($result);
        }

        $attributes = $this->renderAttributes();
        if (strlen($attributes)) {
            $attributes = ' ' . $attributes;
        }

        if ($this->selfClosing) {
            return vsprintf(
                '<%s%s/>',
                [$this->tagName, $attributes]
            );
        }

        return vsprintf(
            '<%s%s>%s</%s>',
            [
                $this->tagName,
                $attributes,
                $this->renderContent(),
                $this->tagName,
            ]
        );
    }
public function render ( ) { $ result = $ this -> spec -> check ( $ this -> attributes ) ; if ( $ result -> failed ( ) ) { throw new InvalidAttributesException ( $ result ) ; } $ attributes = $ this -> renderAttributes ( ) ; if ( strlen ( $ attributes ) ) { $ attributes = ' ' . $ attributes ; } if ( $ this -> selfClosing ) { return vsprintf ( '<%s%s/>' , [ $ this -> tagName , $ attributes ] ) ; } return vsprintf ( '<%s%s>%s</%s>' , [ $ this -> tagName , $ attributes , $ this -> renderContent ( ) , $ this -> tagName , ] ) ; }
Render the Node.

@throws CoreException
@throws InvalidAttributesException
@return string
Render the Node .