MediaWiki REL1_34
JsonContentHandler.php
Go to the documentation of this file.
1<?php
31
32 public function __construct( $modelId = CONTENT_MODEL_JSON ) {
33 parent::__construct( $modelId, [ CONTENT_FORMAT_JSON ] );
34 }
35
39 protected function getContentClass() {
40 return JsonContent::class;
41 }
42
43 public function makeEmptyContent() {
44 $class = $this->getContentClass();
45 return new $class( '{}' );
46 }
47}
Content handler for code content such as CSS, JavaScript, JSON, etc.
Content handler for JSON.
__construct( $modelId=CONTENT_MODEL_JSON)
makeEmptyContent()
Creates an empty TextContent object.
const CONTENT_FORMAT_JSON
Definition Defines.php:251
const CONTENT_MODEL_JSON
Definition Defines.php:228