Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-20204 Themes 2.0: YUI, Caching, Performance, Consistency
  3. MDL-21235

Decide once and for all how the output API will look to developers

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0
    • 2.0
    • Themes
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      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

            skodak Petr Skoda
            skodak Petr Skoda
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.