hkoba / yatt_lite

YATT::Lite - Template with "use strict"
Other
5 stars 0 forks source link

Treat request sigils in query_string of POST as default choice #150

Open hkoba opened 5 years ago

hkoba commented 5 years ago

To write wizard style navigations like ←Back Proceed→ in a single page yatt app, you can put name in each buttons with request_sigil (~ for pages, ! for actions). This works quite well basically, except users hit ENTER (RETURN) on the form controls other than such named buttons. In that case, no sigil parameter is sent from browsers and navigation doesn't work as expected. It is quite disappointing in some web apps like online questionnaires.

So, I want to introduce another convention for request sigil handling. Just write action= for POST form with request sigil, then it is treated as default choice of the form. Yatt looks body_parameters first for request sigil. If there was no request sigil in body_parameters, then it looks query_parameters for request sigil.

Note: This feature will work only in PSGI. In other word, use runplack.cgi instead of runyatt.cgi.