1,801
การแก้ไข
| บรรทัดที่ 779: | บรรทัดที่ 779: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Useful Server-side Patterns == | |||
=== Non-redirecting Submission Route === | |||
Below is an example for Flask route that handles a non-redirecting form submission. For any form that appears on multiple pages, it makes sense to write a single submit route to which all instances of the form point to. | |||
=== Data Fetching Route === | |||
Below is an example for Flask route that handles a data fetch request for CuneiForm. Again, this template is ideal for forms appearing on multiple pages but shares roughly the same fetch logic. | |||
=== All-in-one Route === | |||
Below is an example for Flask route that handles everything for a single-form page. This format is the most frequently written, since most CuneiForms are used on a unique page (or a set of pages that share the same route anyway). | |||
{{The Tenko Shrine}} | {{The Tenko Shrine}} | ||