diff --git a/docs/guide/structure-assets.md b/docs/guide/structure-assets.md index ef7858d632..6ed9f18de5 100644 --- a/docs/guide/structure-assets.md +++ b/docs/guide/structure-assets.md @@ -3,7 +3,7 @@ Assets > Note: This section is under writing. -An asset in Yii is a file that may be referenced or linked on a Web page. It can be a CSS file, a JavaScript file, +An asset in Yii is a file that may be referenced or linked in a Web page. It can be a CSS file, a JavaScript file, an image or video file, etc. For simple Web applications, assets may be managed manually - you place them in a Web folder and reference them using their URLs in your Web pages. However, if an application is complicated, or if it uses many third-party extensions, manual management of assets can soon become a headache. For example, how will you ensure @@ -14,32 +14,21 @@ to production? In this section, we will describe the asset management capability all these problems. -## Asset Types - -Assets, based on their location, can be classified as: - -* source assets: the asset files are located together with PHP source code which cannot be directly accessed via Web. - In order for source assets to be Web accessible, they should be published and turned in *published assets*. -* published assets: the asset files are located in a Web folder and can thus be directly accessed via Web. -* external assets: the asset files are located on a Web server that is different from the one hosting your Web - application. - -As aforementioned, an asset can be a CSS file, a JavaScript file, an image file, and so on, as long as it can -be referenced or linked on a Web page. However, in most cases you would mainly care about CSS files and JavaScript files. -This is because they are the essential pieces in making your Web applications truly dynamic and interactive. - - ## Asset Bundles Assets are organized in *bundles*. An asset bundle represents a collection of asset files located under a single directory. It lists which CSS and JavaScript files are in this collection and should be included -in a page when the bundle is registered with it. +in a page where the bundle is used. -You can register an asset bundle in a [view](structure-views.md), which will generate -`` and `