Register Script File In End Of Head Tag

i have code look like this:


// Add css files

		$cs = Yii::app()->clientScript;

		$cssFile = CHtml::asset(dirname(__FILE__).DIRECTORY_SEPARATOR.'css'.DIRECTORY_SEPARATOR.'mycss.css');

		$cs->registerCssFile($cssFile,CClientScript::POS_HEAD);

        

        // Add js files

        $jsFile = CHtml::asset(dirname(__FILE__).DIRECTORY_SEPARATOR.'js'.DIRECTORY_SEPARATOR.'myjs.js');

		$cs->registerScriptFile($jsFile,CClientScript::POS_HEAD);

but when render:


<head>

    <link rel="stylesheet" type="text/css" href="/store/assets/7e658267/mycss.css" />

    <script type="text/javascript" src="/store/assets/d826f7e/myjs.js"></script>

    <title>My Title</title>

    <link rel='stylesheet' media="screen" href='/store/themes/classic/css/normalize.css'/>

    <link rel='stylesheet' media="screen" href='/store/themes/classic/css/style.css'/>

    <script type="text/javascript" src="/store/themes/classic/js/jquery.js"></script>

    <link rel="shortcut icon" href="/store/themes/classic/images/favicon.png"/>

</head>

the file is not added to the end of head tag, somebody can help me?

I believe they’re inserted relative to the title tag. Try moving your other style sheet and script tags above the title tag and it should do what you need.