Jump to content

Template:Codesample-header/doc

From mediawiki.org

Usage

[edit]

Header for a syntax-highlighted code fragment.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Title1

Title (name) of this code sample. Often a filename

Example
includes/specials/SpecialBlankpage.php
Stringrequired

Example

[edit]

This wikitext:

{{Codesample-header|[https://gerrit.wikimedia.org/g/mediawiki/core/+/REL1_43/includes/specials/SpecialBlankpage.php includes/specials/SpecialBlankpage.php]}}

<syntaxhighlight lang="php">
	public function execute( $par ) {
		$this->setHeaders();
		$this->getOutput()->addWikiMsg( 'intentionallyblankpage' );
	}
</syntaxhighlight>

Displays as:

	public function execute( $par ) {
		$this->setHeaders();
		$this->getOutput()->addWikiMsg( 'intentionallyblankpage' );
	}

See also

[edit]