MediaWiki REL1_34
CodeContentHandler.php
Go to the documentation of this file.
1<?php
29abstract class CodeContentHandler extends TextContentHandler {
30
41 public function getPageLanguage( Title $title, Content $content = null ) {
42 return Language::factory( 'en' );
43 }
44
55 public function getPageViewLanguage( Title $title, Content $content = null ) {
56 return Language::factory( 'en' );
57 }
58
63 protected function getContentClass() {
64 throw new MWException( 'Subclass must override' );
65 }
66
67}
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.
Base content handler implementation for flat text contents.
Represents a title within MediaWiki.
Definition Title.php:42
Base interface for content objects.
Definition Content.php:34
$content
Definition router.php:78