1.修改fields.ini
[ip]
widget:type=hidden
visibility:list=0
2.修改tablename.php -> class tables_tablename 加入
function beforeSave(&$record){
$record->setValue('ip', $_SERVER['REMOTE_ADDR']);
}
這個部落格僅作為個人工作上遇到的問題和解決方案紀錄,相關步驟未經完整驗證,不一定適用於您所遭遇的狀況,系統如有問題建議您諮詢專業人士,不要自行操作不熟悉的指令或動作,以免造成更嚴重的損害。文中所提各軟體屬各軟體所有權人所有,軟體之異常情形大多為本人操作錯誤所造成,並非軟體原始設計之問題,且大多數問題都在軟體版本更新後獲得解決,本人因所知有限未能即時更新相關資訊,謹此致歉。
星期二, 6月 30, 2009
Xataface-製作動態選單
在Xataface中設定動態選單(雙層選單)並不困難,這裡示範的是單一資料表方式,也可將第一層和第二層選單分開存在兩個資料表(areas)。
1.修改valuelists.ini
[cities]
__sql__ = "select city_id, name, province_id from areas order by city_id"
[provinces]
__sql__ = "select province_id,province_name from areas where SUBSTR(city_id,4,2)="00" order by province_id"
2.修改fields.ini
[province]
vocabulary=provinces
[city]
vocabulary=cities
3.修改應用程式目錄/tables/tablename.php
class tables_tablename {
http://xataface.com/wiki/index.php?-table=wiki&-action=browse&page_id=%3D90
} //End of class
province_id | city_id | name |
U01 | U0100 | province_1 |
U01 | U0101 | city_1 |
U01 | U0102 | city_2 |
U02 | U0200 | province_2 |
U02 | U0201 | city_3 |
U02 | U0202 | city_4 |
1.修改valuelists.ini
[cities]
__sql__ = "select city_id, name, province_id from areas order by city_id"
[provinces]
__sql__ = "select province_id,province_name from areas where SUBSTR(city_id,4,2)="00" order by province_id"
2.修改fields.ini
[province]
vocabulary=provinces
[city]
vocabulary=cities
3.修改應用程式目錄/tables/tablename.php
class tables_tablename {
http://xataface.com/wiki/index.php?-table=wiki&-action=browse&page_id=%3D90
} //End of class
訂閱:
文章 (Atom)