src/SellerLabs/Nucleus/View/Node.php
protected function renderAttribute($name, $value = null)
    {
        if ($value === null) {
            return $name;
        }

        if (is_array($value)) {
            $value = implode(' ', $value);
        }

        return vsprintf('%s="%s"', [
            $name,
            Html::escape((string) $value),
        ]);
    }
protected function renderAttribute($name, $value = null)
    {
        if ($value === null) {
            return $name;
        }

        if (is_array($value)) {
            $value = implode(' ', $value);
        }

        return vsprintf('%s="%s"', [
            $name,
            Html::escape((string) $value),
        ]);
    }
protected function renderAttribute ( $ name , $ value = null ) { if ( $ value === null ) { return $ name ; } if ( is_array ( $ value ) ) { $ value = implode ( ' ' , $ value ) ; } return vsprintf ( '%s="%s"' , [ $ name , Html :: escape ( ( string ) $ value ) , ] ) ; }
Render a single attribute in a node.

@param string $name
@param null|string $value

@return string
Render a single attribute in a node .