Moodle

do not use standard "get_x" methods for "magic" $PAGE stuff

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Themes
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

I found it funny that ppl still use things like $PAGE->get_context() even if we have
Please do not call this method directly, use the ->headerprinted syntax. {@link __get()}.
in the pagelib.

Solution is easy, use some really silly prefix like "magic_get_"
This would allow us to implement true "get_" methods for things like $PAGE->get_renderer() which needs method parameters and can not be implemented through the __get magic.

Activity

Hide
Petr Škoda (skodak) added a comment -

hmm, it does not even have to be public

Show
Petr Škoda (skodak) added a comment - hmm, it does not even have to be public
Hide
Petr Škoda (skodak) added a comment -

done

Show
Petr Škoda (skodak) added a comment - done

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: