[%
options = [ '' ];
cgi.popup_menu(
'state',
options.merge( states ),
'',
{ '' => 'Pick A State, Any State' }
);
%]
Update: ah, I didn't even notice that you were handling stickiness via the SQL query. I think that just goes to prove my point though. It is a very neat hack, granted — I might use it in a short script that's about as complex as what you have. However, you are coupling the SQL, the query parameter names and the template very tightly that way. If you do that sort of thing in 30 places of a larger codebase, it'll become annoying to maintain very quickly.
Makeshifts last the longest.
|