MediaWiki  master
CodeContentHandler.php
Go to the documentation of this file.
1 <?php
25 
33 abstract 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.
Definition: MWException.php:29
Service locator for MediaWiki core services.
Base content handler implementation for flat text contents.
Represents a title within MediaWiki.
Definition: Title.php:49
Base interface for content objects.
Definition: Content.php:35
$content
Definition: router.php:76