官方文檔,
http://www.yiiframework.com/doc/guide/1.1/zh_cn/basics.convention
中文版
Yii 假定了一系列默認的目錄用於不同的場合。如果需要,每個目錄都可以自定義。
-
WebRoot/protected
:這是 應用基礎目錄, 是放置所有安全敏感的PHP腳本和數據文件的地方。Yii 有一個默認的
application
別名指向此目錄。 此目錄及目錄中的文件應該保護起來防止Web用戶訪問。它可以通過 CWebApplication::basePath 自定義。 -
WebRoot/protected/runtime
:此目錄放置應用在運行時產生的私有臨時文件。 此目錄必須對 Web 服務器進程可寫。它可以通過 CApplication::runtimePath自定義。
-
WebRoot/protected/extensions
:此目錄放置所有第三方擴展。 它可以通過 CApplication::extensionPath自定義。
-
WebRoot/protected/modules
:此目錄放置所有的應用 模塊,每個模塊使用一個子目錄。
-
WebRoot/protected/controllers
:此目錄放置所有控制器類文件。 它可以通過CWebApplication::controllerPath 自定義。
-
WebRoot/protected/views
:此目錄放置所有試圖文件, 包含控制器視圖,佈局視圖和系統視圖。 它可以通過 CWebApplication::viewPath 自定義。
-
WebRoot/protected/views/ControllerID
:此目錄放置單個控制器類中使用的視圖文件。 此處的
ControllerID
是指控制器的 ID 。它可以通過 CController::viewPath 自定義。 -
WebRoot/protected/views/layouts
:此目錄放置所有佈局視圖文件。它可以通過CWebApplication::layoutPath 自定義。
-
WebRoot/protected/views/system
:此目錄放置所有系統視圖文件。 系統視圖文件是用於顯示異常和錯誤的模板。它可以通過 CWebApplication::systemViewPath 自定義。
-
WebRoot/assets
:此目錄放置公共資源文件。 資源文件是可以被髮布的,可由Web用戶訪問的私有文件。此目錄必須對 Web 服務器進程可寫。 它可以通過 CAssetManager::basePath 自定義
-
WebRoot/themes
:此目錄放置應用使用的不同的主題。每個子目錄即一個主題,主題的名字即目錄的名字。 它可以通過 CThemeManager::basePath 自定義。
testwebap的目錄結構,以後的文檔可能用到。大體預覽一下。
├── assets
│ ├── 477ed7f4
│ ├── 6f2a3a1a
│ └── 916d6077
├── css
│ ├── bg.gif
│ ├── form.css
│ ├── ie.css
│ ├── main.css
│ ├── print.css
│ └── screen.css
├── images
├── index.php
├── index-test.php
├── protected
│ ├── commands
│ ├── components
│ ├── config
│ ├── controllers
│ ├── data
│ ├── extensions
│ ├── messages
│ ├── migrations
│ ├── models
│ ├── modules
│ ├── runtime
│ ├── tests
│ ├── views
│ ├── yiic
│ ├── yiic.bat
│ └── yiic.php
└── themes
└── classic
/www/yii_dev/testwebap# tree
.├── assets
│ ├── 477ed7f4
│ │ ├── autocomplete
│ │ │ ├── indicator.gif
│ │ │ └── jquery.autocomplete.css
│ │ ├── jquery.ajaxqueue.js
│ │ ├── jquery.autocomplete.js
│ │ ├── jquery.ba-bbq.js
│ │ ├── jquery.bgiframe.js
│ │ ├── jquery.cookie.js
│ │ ├── jquery.js
│ │ ├── jquery.maskedinput.js
│ │ ├── jquery.metadata.js
│ │ ├── jquery.min.js
│ │ ├── jquery.multifile.js
│ │ ├── jquery.rating.js
│ │ ├── jquery.treeview.async.js
│ │ ├── jquery.treeview.edit.js
│ │ ├── jquery.treeview.js
│ │ ├── jquery.yiiactiveform.js
│ │ ├── jquery.yii.js
│ │ ├── jquery.yiitab.js
│ │ ├── jui
│ │ │ ├── css
│ │ │ │ └── base
│ │ │ │ ├── images
│ │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png
│ │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png
│ │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png
│ │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png
│ │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png
│ │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png
│ │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png
│ │ │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png
│ │ │ │ │ ├── ui-icons_222222_256x240.png
│ │ │ │ │ ├── ui-icons_2e83ff_256x240.png
│ │ │ │ │ ├── ui-icons_454545_256x240.png
│ │ │ │ │ ├── ui-icons_888888_256x240.png
│ │ │ │ │ └── ui-icons_cd0a0a_256x240.png
│ │ │ │ ├── jquery.ui.accordion.css
│ │ │ │ ├── jquery.ui.all.css
│ │ │ │ ├── jquery.ui.autocomplete.css
│ │ │ │ ├── jquery.ui.base.css
│ │ │ │ ├── jquery.ui.button.css
│ │ │ │ ├── jquery.ui.core.css
│ │ │ │ ├── jquery-ui.css
│ │ │ │ ├── jquery.ui.datepicker.css
│ │ │ │ ├── jquery.ui.dialog.css
│ │ │ │ ├── jquery.ui.progressbar.css
│ │ │ │ ├── jquery.ui.resizable.css
│ │ │ │ ├── jquery.ui.selectable.css
│ │ │ │ ├── jquery.ui.slider.css
│ │ │ │ ├── jquery.ui.tabs.css
│ │ │ │ └── jquery.ui.theme.css
│ │ │ ├── js
│ │ │ │ ├── jquery-ui-i18n.min.js
│ │ │ │ └── jquery-ui.min.js
│ │ │ └── MIT-LICENSE.txt
│ │ ├── rating
│ │ │ ├── delete.gif
│ │ │ ├── jquery.rating.css
│ │ │ └── star.gif
│ │ ├── treeview
│ │ │ ├── images
│ │ │ │ ├── ajax-loader.gif
│ │ │ │ ├── file.gif
│ │ │ │ ├── folder-closed.gif
│ │ │ │ ├── folder.gif
│ │ │ │ ├── minus.gif
│ │ │ │ ├── plus.gif
│ │ │ │ ├── treeview-black.gif
│ │ │ │ ├── treeview-black-line.gif
│ │ │ │ ├── treeview-default.gif
│ │ │ │ ├── treeview-default-line.gif
│ │ │ │ ├── treeview-famfamfam.gif
│ │ │ │ ├── treeview-famfamfam-line.gif
│ │ │ │ ├── treeview-gray.gif
│ │ │ │ ├── treeview-gray-line.gif
│ │ │ │ ├── treeview-red.gif
│ │ │ │ └── treeview-red-line.gif
│ │ │ └── jquery.treeview.css
│ │ └── yiitab
│ │ └── jquery.yiitab.css
│ ├── 6f2a3a1a
│ │ └── pager.css
│ └── 916d6077
│ ├── detailview
│ │ └── styles.css
│ ├── gridview
│ │ ├── bg.gif
│ │ ├── delete.png
│ │ ├── down.gif
│ │ ├── jquery.yiigridview.js
│ │ ├── loading.gif
│ │ ├── styles.css
│ │ ├── update.png
│ │ ├── up.gif
│ │ └── view.png
│ └── listview
│ ├── down.gif
│ ├── jquery.yiilistview.js
│ ├── loading.gif
│ ├── styles.css
│ └── up.gif
├── css
│ ├── bg.gif
│ ├── form.css
│ ├── ie.css
│ ├── main.css
│ ├── print.css
│ └── screen.css
├── images
├── index.php
├── index-test.php
├── protected
│ ├── commands
│ │ ├── shell
│ │ ├── TestCommand.php
│ │ └── TestCommand.php~
│ ├── components
│ │ ├── Controller.php
│ │ └── UserIdentity.php
│ ├── config
│ │ ├── console.php
│ │ ├── console.php~
│ │ ├── main.php
│ │ ├── main.php~
│ │ └── test.php
│ ├── controllers
│ │ ├── SiteController.php
│ │ ├── TestController.php
│ │ └── UserController.php
│ ├── data
│ │ ├── schema.mysql.sql
│ │ ├── schema.sqlite.sql
│ │ └── testdrive.db
│ ├── extensions
│ ├── messages
│ │ ├── config.php
│ │ └── zh_cn
│ │ ├── login_message.php
│ │ └── login_message.php~
│ ├── migrations
│ ├── models
│ │ ├── ContactForm.php
│ │ ├── LoginForm.php
│ │ └── User.php
│ ├── modules
│ │ └── testmod
│ │ ├── components
│ │ ├── controllers
│ │ │ └── DefaultController.php
│ │ ├── messages
│ │ ├── models
│ │ ├── TestmodModule.php
│ │ └── views
│ │ ├── default
│ │ │ ├── index.php
│ │ │ └── index.php~
│ │ └── layouts
│ ├── runtime
│ │ └── application.log
│ ├── tests
│ │ ├── bootstrap.php
│ │ ├── fixtures
│ │ │ └── tbl_user.php
│ │ ├── functional
│ │ │ ├── SiteTest.php
│ │ │ └── UserTest.php
│ │ ├── phpunit.xml
│ │ ├── report
│ │ ├── unit
│ │ │ └── UserTest.php
│ │ └── WebTestCase.php
│ ├── views
│ │ ├── layouts
│ │ │ ├── column1.php
│ │ │ ├── column2.php
│ │ │ ├── main.php
│ │ │ └── main.php~
│ │ ├── site
│ │ │ ├── contact.php
│ │ │ ├── error.php
│ │ │ ├── index.php
│ │ │ ├── login.php
│ │ │ └── pages
│ │ │ └── about.php
│ │ ├── test
│ │ │ ├── action1.php
│ │ │ ├── action2.php
│ │ │ ├── action3.php
│ │ │ └── index.php
│ │ └── user
│ │ ├── admin.php
│ │ ├── create.php
│ │ ├── _form.php
│ │ ├── index.php
│ │ ├── _search.php
│ │ ├── update.php
│ │ ├── userformtest.php
│ │ ├── _view.php
│ │ └── view.php
│ ├── yiic
│ ├── yiic.bat
│ └── yiic.php
└── themes
└── classic
└── views
├── layouts
├── site
└── system
58 directories, 153 files