Awesome
Multidomain ClientScript (assets)
Extending default Yii CClientScript class to use multiple subdomains for assets (scripts and stylesheets).
Preinstall
You should make sure, that your HTTP-server configured properly - 'assetsSubdomain'
and all its combinations are pointing to your 'public_html'
directory.
Install and config (available and default settings)
Place StaticClientScript.php
file into protected/components
directory.
After this, you can enhance CClientScript
class by making some changes in your config file (protected/config/main.php
):
Params
enableMultidomainAssets
- whether to use subdomains for ClientScript assets. Default istrue
assetsSubdomain
- subdomain name (e.g.http://assets.example.com
). Default is'assets'
indexedAssetsSubdomain
- whether to use indexed subdomains for registered script files basing on their'position'
param. Default isfalse
Examples
Example for indexedAssetsSubdomain = true
param: