<%def name="optionselected(x)"><%if x: __M_writer(u"selected")%></%def> <option value="python" ${optionselected(c.id == "python")}></option>
Sunday, April 25, 2010
Little tip of Mako template
“selected” is always used to indicate selected state of option in SELECT HTML component. So it’s useful to write “selected” in one line as its option tag. Following code will generate this:
Subscribe to:
Post Comments (Atom)
context.write('my sting')
ReplyDelete