MediaWiki REL1_37
CodeContentHandler.php
Go to the documentation of this file.
1<?php
25
33abstract class CodeContentHandler extends TextContentHandler {
34
47 public function getPageLanguage( Title $title, Content $content = null ) {
48 return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
49 }
50
63 public function getPageViewLanguage( Title $title, Content $content = null ) {
64 return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
65 }
66
73 protected function getContentClass() {
74 throw new MWException( 'Subclass must override' );
75 }
76
77}
Content handler for code content such as CSS, JavaScript, JSON, etc.
getPageViewLanguage(Title $title, Content $content=null)
Returns the English language, because code is English, and should be handled as such.
getPageLanguage(Title $title, Content $content=null)
Returns the English language, because code is English, and should be handled as such.
MediaWiki exception.
MediaWikiServices is the service locator for the application scope of MediaWiki.
Base content handler implementation for flat text contents.
Represents a title within MediaWiki.
Definition Title.php:48
Base interface for content objects.
Definition Content.php:35
$content
Definition router.php:76