yiisoft/yii — pull request #726 by resurtm (2012-05-18 17:09:34+00:00)
Title: CClientScript: $scriptFilePosition and $scriptPosition for controlling default $position values for registerScriptFile and registerScript.

`CClientScript` improvement

Usually i'm creating my own version of `CClientScript` called `ClientScript` (which extends `CClientScript`) and it does only one thing: changes default value of third argument in `CClientScript::registerScript()` and second argument in `CClientScript::registerScriptFile()`. Why not to extend CClientScript in Yii core?

API BC in this PR is okay.

Practical example to be more clear. Application layout:
```php

<?php echo CHtml::encode($this->pageTitle); ?>

clientScript; ?>

registerCoreScript('jquery'); ?>

registerScriptFile('/js/html5placeholder.jquery.js',CClientScript::POS_END); ?>
registerScriptFile('/js/main.js',CClientScript::POS_END); ?>

```

Why we should repeat `CClientScript::POS_END` over and over? My usual solution is to create extended version of `CClientScript`:
```php
class ClientScript extends CClientScript
{
public function registerScriptFile($url, $position=CClientScript::POS_END)
{
return parent::registerScriptFile($url, $position);
}
}
```