-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
เขียน url mapping parser #11
Comments
ในจุดนี้ ผมคิดว่าควรใช้ Regx แล้วก็ Map ควบคู่กันดีหรือเปล่าครับ? |
จริง ๆ ใช้ regex ก็อาจจะดี แต่มันอาจจะลำบากไปสำหรับคนที่จะเอาไปใช้ เดี๋ยวจะลอง check ของ Rails 3 ดูอีกทีว่าใช้การ map แบบไหน |
ผมก็มองว่า DSL อาจจะเป็นทางเลือกที่ดี เดวจะลองศึกษาเพิ่มเติมดูในเรื่องของความเหมาะสมเหมือนกันครับ |
สวัสดีครับ เนื่องจากงานราษยุ่งนิดหน่อยครับ :( ตอนนี้กำลังแกะเกรล์ |
ก็อาจจะแค่ split ด้วย / ก่อน |
ผมลองทำแบบใช้เป็น map ดูครับแล้วก็เอาไปเชคใน SplitController method โค๊ดค่อนข้างจะไม่ค่อยสวยเท่าไหร่นะครับ กำลังค่อยๆปรับครับ เนื่องจากเป็นมือใหม่ Go |
ตัวทำ routing จะสามารถทำการ map ด้วยข้อความประมาณนี้ได้ (ตาม Grails)
"/", controller:"hello"
"/$controller/$action/$id?"
"/blog/$year/$month/$day"
แล้ว controller กับ action จะ map หา Controller struct และ Action method
ส่วนค่าอื่นจะเป็น Params
The text was updated successfully, but these errors were encountered: