基本上如cakephp手冊所說的,一個Model對應到一個Table,而Controller則是負責處理使用者網址上所請求的參數,並到Model中執行相關動作後,輸出到View,這邊先把目前想到的Controller與Model/method 先列出,應該有很多要修改而且有些method可以用cake自動完成,要再詳細看cake,不過我還是先列再說吧XD
Model
User(對應table:users)
-bool register(array) //註冊一個新使用者,input array之key為table field
-bool update_profile(array) //修改使用者資料,input array之key為table field
-bool login() //使用post資料
-bool logout() //使用post資料
-mixed get_profile()
-mixed get_recommendation_list()
-mixed get_friend_list()
-mixed get_favorite_list()
-mixed get_song_list()
Song(對應table:songs)
-bool add(array) //array裡要包含歌曲檔案路徑
-mixed get_song_data()
-mixed get_recommend_list()
-mixed get_review() //聽歌心得
Forum(table:forums) //討論版
-bool add() //新增討論版
-bool delete()
-bool add_topic() //新增主題
-bool delete_topic()
-bool add_reply()
-bool delete_reply()
-mixed get_all_topic()
-mixed get_reply()
........先po這樣,看來問題很大 orz
先再多看看cake再回來po
有些method該放哪想不清楚
沒有留言:
張貼留言