1/ the old way - $OUTPUT->single_button($url, $label, ...) which allows single_button object in first param too
benefits:
- extremely easy migration from print_single_button() in 1.9
- easy for new ppl that use code completion in IDEs - type $OUUTPUT ==> then you get list of methods ==> then you get all single_button() parameters and links to advanced usage
- make methods are optionally possible too
2/ make factory methods
$OUTPUT->print(single_button::make($url, $label, ...))
problems:
- no code completion possible
- totally different from 1.9
- custom OOP style (not in Java or anything else I know)
- Eloy does not like static methods :-P
3/ $OUTPUT->button(html_form::make_single_button())
it has the worst of both worlds
Please submit more cons and pros as comments
- has been marked as being related by
-
MDL-36953 html_writer::select allow for multiple 'nothing' values but these are not actually supported by the auto submission JS
-
- Closed
-