Dynamic Routing Cont.

Dynamic Routing Cont. ":params" and

Dynamic Routing Cont. ":params" and "*splats"
Backbone uses two styles of variables when implementing routes. First there are ":params" which match any URL components between slashes. Then there are "splats" which match any number of URL components. Note that due to the nature of a "splat" it will always be the last variable in your URL as it will match any and all components.

Any "*splats" or ":params" in route definitions are passed as arguments (in respective order) to the associated function. A route defined as "/:route/:action" will pass 2 variables (“route” and “action”) to the callback function. (If this is confusing please post a comment and I will try articulate it better)

Here are some examples of using ":params" and "*splats
0/5000
From: -
To: -
Results (Thai) 1: [Copy]
Copied!
สำเนาเส้นทางแบบไดนามิก ": params " และ " * splats "แกนหลักใช้สองลักษณะของตัวแปรเมื่อใช้เส้นทาง ครั้งแรก มี ": params " ซึ่งตรงกับส่วนประกอบของ URL ใด ๆ ระหว่างเครื่องหมายทับ แล้ว มี "splats" ซึ่งตรงกับหมายเลขใด ๆ ของส่วนประกอบของ URL โปรดสังเกตว่า เนื่องจากลักษณะของ "splat" มันจะเสมอเป็นตัวแปรสุดท้ายใน URL ของคุณก็จะตรงกับส่วนประกอบใด ๆ ทั้งหมดใด ๆ " * splats "หรือ": params " ในกระบวนการผลิต ข้อกำหนดจะถูกส่งผ่านเป็นอาร์กิวเมนต์ (เป็นลำดับ) ฟังก์ชันเกี่ยวข้อง กระบวนการผลิตที่กำหนดเป็น " /: กระบวนการผลิต /: การกระทำ" จะผ่าน 2 ตัวแปร ("เส้นทาง" และ "การกระทำ") ไปยังฟังก์ชันการเรียกกลับ (ถ้าเป็นสับสน กรุณาแสดงความคิดเห็น และจะพยายามบอกดีกว่า)นี่เป็นตัวอย่างของการใช้ ": params " และ " * splats
Being translated, please wait..
Results (Thai) 2:[Copy]
Copied!
การกำหนดเส้นทางแบบไดนามิกต่อ "params" และ "* เครื่องหมาย"
Backbone ใช้สองรูปแบบของตัวแปรเมื่อใช้เส้นทาง ครั้งแรกที่มี ": params" ซึ่งตรงกับส่วนประกอบ URL ระหว่างทับ จากนั้นก็มี "เครื่องหมาย" ซึ่งตรงกับหมายเลขของส่วนประกอบ URL ใด ๆ โปรดทราบว่าเนื่องจากลักษณะของ "แดง" มันจะเป็นตัวแปรสุดท้ายใน URL ของคุณในขณะที่มันจะตรงกับการใด ๆ และทุกองค์ประกอบ. ใด ๆ "* เครื่องหมาย" หรือ ": params" ในนิยามเส้นทางจะผ่านเป็นอาร์กิวเมนต์ (ในแต่ละ การสั่งซื้อ) ฟังก์ชั่นที่เกี่ยวข้อง เส้นทางที่กำหนดให้เป็น "/ เส้นทาง /: การกระทำ" จะผ่าน 2 ตัวแปร ("เส้นทาง" และ "การกระทำ") เพื่อฟังก์ชั่นการโทรกลับ (ในกรณีนี้คือความสับสนกรุณาโพสต์ความคิดเห็นและฉันจะพยายามที่ชัดเจนได้ดี) นี่เป็นตัวอย่างของการใช้ ": params" และ "* เครื่องหมาย



Being translated, please wait..
Results (Thai) 3:[Copy]
Copied!
การจัดเส้นทางแบบไดนามิกคอน " : params " และ " สีน้ำ "
2 ลักษณะของตัวแปรหลักที่ใช้เมื่อมีการใช้เส้นทาง แรกมี " : params " ซึ่งตรงกับ URL ใด ๆส่วนประกอบระหว่าง slashes . แล้วมี " สีน้ำ " ซึ่งตรงกับหมายเลขใด ๆของส่วนประกอบของ URL หมายเหตุ เนื่องจากธรรมชาติของ " เครื่องหมาย " มันจะเปลี่ยนแปลงครั้งสุดท้ายใน URL ของคุณจะตรงกับทุกส่วนประกอบ

ใด ๆ " * สีน้ำ " หรือ " : params " ในคำนิยามเส้นทางผ่านเป็นอาร์กิวเมนต์ ( ตามลำดับ ) เพื่อเชื่อมโยงการทำงาน เส้นทางที่กำหนดไว้เป็น " / : / เส้นทาง : การกระทำ " จะผ่าน 2 ตัวแปร ( " เส้นทาง " และ " การกระทำ " ) ฟังก์ชันการเรียกกลับ ( ถ้าเป็นสับสน โปรดแสดงความคิดเห็นและฉันจะพยายามออกเสียงให้ดีขึ้น )

นี่คือบางตัวอย่างของการใช้ " : params " และ " * สีน้ำ
Being translated, please wait..
 
Other languages
The translation tool support: Afrikaans, Albanian, Amharic, Arabic, Armenian, Azerbaijani, Basque, Belarusian, Bengali, Bosnian, Bulgarian, Catalan, Cebuano, Chichewa, Chinese, Chinese Traditional, Corsican, Croatian, Czech, Danish, Detect language, Dutch, English, Esperanto, Estonian, Filipino, Finnish, French, Frisian, Galician, Georgian, German, Greek, Gujarati, Haitian Creole, Hausa, Hawaiian, Hebrew, Hindi, Hmong, Hungarian, Icelandic, Igbo, Indonesian, Irish, Italian, Japanese, Javanese, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Korean, Kurdish (Kurmanji), Kyrgyz, Lao, Latin, Latvian, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Myanmar (Burmese), Nepali, Norwegian, Odia (Oriya), Pashto, Persian, Polish, Portuguese, Punjabi, Romanian, Russian, Samoan, Scots Gaelic, Serbian, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Spanish, Sundanese, Swahili, Swedish, Tajik, Tamil, Tatar, Telugu, Thai, Turkish, Turkmen, Ukrainian, Urdu, Uyghur, Uzbek, Vietnamese, Welsh, Xhosa, Yiddish, Yoruba, Zulu, Language translation.

Copyright ©2025 I Love Translation. All reserved.

E-mail: