Return to Snippet

Revision: 51145
at September 16, 2011 00:30 by jose_506


Initial Code
/**
* Generate line include src script
* @param string $src : string with route from script
*/
function link_script($src = '')
{       
    $index_page = FALSE;
    $type = 'text/javascript';

    $CI =& get_instance();

    $link = '<script ';

    if ( strpos($src, '://') !== FALSE)
    {
            $link .= 'src="'.$src.'" ';
    }
    else
    {
            $link .= 'src="'.$CI->config->slash_item('base_url').$src.'"';
    }
    $link .= ' type="'.$type.'">';

    $link .= '</script>';
    return $link;
}

Initial URL

                                

Initial Description

                                

Initial Title
Generate script html tag

Initial Tags

                                

Initial Language
PHP