Option to put registered scripts in footer, or where you would like

It’s often best practice in frontend development to load JavaScript in the footer, before the closing body tag. This way, the loading of large scripts does not hold up loading of the rest of the page.

In order to do this with Yii, I’ve had to set the script map entries for jquery and jquery.yiiactiveform.js to false. It would be great if there was an option to have Yii place them before the closing body tag, and/or a way of manually being able to say where to place them in the template. Right now, it places before the title tag

(another very minor thing for us code indention perfectionists…if you have the tags under HEAD indented, it will screw up the indention with how it adds the code/line break in)

Have you tried to set the coreScriptPossition - http://www.yiiframework.com/doc/api/1.1/CClientScript#coreScriptPosition-detail

Can that be set globally, to apply to the JS and CSS that Yii is adding automatically? It’s just a pain to keep things organized. I don’t like all these extra HTTP requests, so I am trying to combine JS and CSS where I can too. I may just give in and put jQuery in the header.

You can set it in the config file… note that this is only for core scripts…

Hello. I second that request. In my first Yii project, I didn’t pay attention and I noticed too late that the scripts file that are registered automatically are put in the head, before the title…

For a current project, I ended up writing my own script tags at the end of body tag, except html5shiv of course.

@jwinn on a side note, does putting your CSS in the footer work?