MediaWiki 1.40.4
CodeContentHandler.php
Go to the documentation of this file.
1<?php
26
34abstract class CodeContentHandler extends TextContentHandler {
35
48 public function getPageLanguage( Title $title, Content $content = null ) {
49 return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
50 }
51
64 public function getPageViewLanguage( Title $title, Content $content = null ) {
65 return MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( 'en' );
66 }
67
74 protected function getContentClass() {
75 throw new MWException( 'Subclass must override' );
76 }
77
78}
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.
Service locator for MediaWiki core services.
Represents a title within MediaWiki.
Definition Title.php:82
Base content handler implementation for flat text contents.
Base interface for representing page content.
Definition Content.php:37
$content
Definition router.php:76