Manual:Article.php/zh

类处理MediaWiki页面及其历史记录的呈现和交互. 它与类密切相关，后者为页面提供模型对象.

例如，该文件包含一个用于查看页面的函数 ，从 调用(另一个版本在 中). 此函数使用函数 、 和 从数据库获取页面的wikitext ，并将其分配给. 之后，它调用函数 (已弃用)来处理.



创建新的条目对象
要实例化 ，请调用静态工厂方法之一或使用构造函数：


 * - 其中， 是文章ID(与相同).
 * - 为给定标题创建相应类的文章对象.
 * - 为给定页创建相应类的文章对象.
 * - 从给定标题创建一个文章对象.

方法

 * (superseded by ) - 获取此修订版的文本. 这个功能有副作用. 如果您只需要真实的修订文本(如果有)，请不要使用此功能.
 * (1.18+) - 获取在其中执行此项目的上下文.
 * - gets the oldid of the article that is to be shown, or 0 for the current revision.
 * (1.19+) - gets the WikiPage object of this instance.
 * - gets the parser options suitable for rendering the primary article wikitext.
 * - a lightweight method to get the parser output for a page, checking the parser cache and so on. It doesn't consider most of the stuff that  is forced to consider.
 * - gets the rev ID used on page views.
 * (1.19+) - get the fetched Revision object depending on request parameters or null on failure.
 * - gets the robot policy to be used for the current view.  is a string containing the action= GET parameter and.
 * - gets the Title associated with this page.
 * - returns true if the currently-referenced revision is the current edit to this page (and it exists).
 * - returns true if the page can be cached.
 * - this method handles the (default) action of viewing a page. Actions (like 'view', 'revert', 'delete', etc) are handled by Action subclasses. The  method of the ViewAction calls   to do the actual work.

See https://doc.wikimedia.org/mediawiki-core/master/php/classArticle.html for a complete lists of methods.

钩子
Hooks called from this file are listed in the category.

