Manual:Architectural modules/OutputPage

Responsibilities
OutputPage represents an object, that incorporates the necessary information to produce the final HTML view of the page. An essential part of this information comes from, where (HTML text of the page body) is the most important one. When these and other relevant parts are accumulated in the OutputPage, it is ready to output all this information by calling Skin module for rendering it properly. OutputPage handles outputting of all kinds of pages (articles, talk pages, file pages etc.) and special pages. It also handles the output of error pages. When something goes wrong with the request, for example, a user without right permissions is trying to delete a page, it will prepare a necessary error page and pass it to the Skin module.

Implementation Information
OutputPage module is implemented as a single class. It has 64 member variables that hold all the information relevant for the output of the page in HTML. Some of the common member variables for all types of pages are listed below:


 * – the title of the page
 * – the text of HTML element
 * – the timestamp of last modification
 * – modules (JavaScript or CSS files) that should be loaded
 * – indicates, whether output is disabled (a cached version from the browser will be served)
 * – HTTP vary header

Some member variables are only applicable for specific types of pages. For example, history page will have such fields as, or  set to null, as it does not show a single page, but a list of previous revisions. And only a file page will have filled with value, as other pages do not have this information. Thus, is a generic object that will be filled with data, that needs to be present for a specific type of page, leaving irrelevant fields empty.

The core method here is, that calls Skin module for creating the final HTML. Furthermore, it has several methods to prepare error pages, that will be eventually handled again by the method.