MediaWiki  1.34.0
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_MODEL_JSON
const CONTENT_MODEL_JSON
Definition: Defines.php:219
CodeContentHandler
Content handler for code content such as CSS, JavaScript, JSON, etc.
Definition: CodeContentHandler.php:29
JsonContentHandler\getContentClass
getContentClass()
Definition: JsonContentHandler.php:39
CONTENT_FORMAT_JSON
const CONTENT_FORMAT_JSON
Definition: Defines.php:242
JsonContentHandler\makeEmptyContent
makeEmptyContent()
Creates an empty TextContent object.
Definition: JsonContentHandler.php:43
JsonContentHandler
Content handler for JSON.
Definition: JsonContentHandler.php:30
JsonContentHandler\__construct
__construct( $modelId=CONTENT_MODEL_JSON)
Definition: JsonContentHandler.php:32