public function appendToHead($element)
    {
        // Check if the element is valid
        if (empty($element)) {
            throw new InvalidArgumentException('The element provided is empty.');
        }

        // Append element to head
        $this->getHead()->append($element);

        return $this;
    }
public function appendToHead($element)
    {
        // Check if the element is valid
        if (empty($element)) {
            throw new InvalidArgumentException('The element provided is empty.');
        }

        // Append element to head
        $this->getHead()->append($element);

        return $this;
    }
public function appendToHead ( $ element ) { // Check if the element is valid if ( empty ( $ element ) ) { throw new InvalidArgumentException ( 'The element provided is empty.' ) ; } // Append element to head $ this -> getHead ( ) -> append ( $ element ) ; return $ this ; }
Append element to head.

@param HTMLElement $element The element to be appended.

@return $this
@throws InvalidArgumentException
Append element to head .