public function generateScripts()
    {
        $result = '';

        $rawScript     = [];
        $this->scripts = array_unique($this->scripts, SORT_REGULAR);
        foreach ($this->scripts as $scriptInfo) {
            if (!$scriptInfo[2]) {
                $result.= '<script src="'.$scriptInfo[0].'" type="'.$scriptInfo[1].'"></script>';
            } else {
                $rawScript[$scriptInfo[1]] = isset($rawScript[$scriptInfo[1]]) ? $rawScript[$scriptInfo[1]] .= $scriptInfo[0]
                        : $scriptInfo[0];
            }
        }
        foreach ($rawScript as $type => $script) {
            $result.= '<script type="'.$type.'">'.$script.'</script>';
        }

        return $result;
    }