Difference between #1 and #4 of
Understanding "Assets"

Changes

Title unchanged

Understanding "Assets"

Category unchanged

Tutorials

Yii version unchanged

Tags changed

assets, understanding

Content changed

[...]
Yii::getPathOfAlias('xxii.assets') );
return $this->_assetsUrl;
}
....

// xxii/views/layouts/main.
cphp

<link rel="stylesheet"
[...]
* **Do not** manually edit any file under `assets/` - if you have a real need to make a change, find the publishing module, edit the source, delete the subfolder under `assets/`, and let Yii re-publish the updated files.
* **Do not** reference names under the `assets/` folder directly (say, to get at some other module's assets). If you need to use that
* **Do not** add the contents of the `assets/` folder to any source-code control system; these files have master source in other places.
 
* It is safe to delete everything under `assets/`. Yii will re-publish the assets if they are not found under `assets/`.
Upgrading Yii ------------- TWhen upgrade instructions to every new release of Yii include the note:
 
 
- Clean up your 'assets' folder.
 
 
This means to **delete** the contents of this folder (but leave the folder itself behind): Yii will re-deploy these assets from the new versi
ing to a new release of Yii, you do not need to clean up the folders under `assets/`. Yii will automatically re-publish assets to new folders based ons the first time each one is used.
 
 
This step is important!
 
 
Yii only publishes the resource files if the target unique-name folder does not exist, so if they're not removed during an upgrade, then the new version of the code will use old versions of asset files: this probably matters.
Yii version number. The old folders will remain there and unused.
 
 
If you are using the SVN development branch of Yii and find any asset file updated in the Yii framework after SVN update (e.g. `jquery.yiigridview.js` is changed due to a bug fix), you should clean up your `assets` folder so that the updated asset files can be re-published.
 
 
46 0
40 followers
Viewed: 207 919 times
Version: 1.1
Category: Tutorials
Written by: Steve Friedl
Last updated by: GOsha
Created on: Feb 19, 2011
Last updated: 12 years ago
Update Article

Revisions

View all history