Redaxscript\Head\Link::render PHP Method

render() public method

render the link
Since: 3.0.0
public render ( ) : string
return string
    public function render()
    {
        $output = null;
        /* html elements */
        $metaElement = new Html\Element();
        $metaElement->init('link');
        $collectionArray = self::$_collectionArray[self::$_namespace];
        $collectionKeys = array_keys($collectionArray);
        $lastKey = end($collectionKeys);
        /* process collection */
        foreach ($collectionArray as $key => $value) {
            $output .= $metaElement->copy()->attr($value);
            if ($key !== $lastKey) {
                $output .= PHP_EOL;
            }
        }
        $this->clear();
        return $output;
    }