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

Details

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

    Description

      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

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              skodak Petr Skoda
              Nobody Nobody
              Huong Nguyen, Bas Brands, Mathew May
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Nov/10