Jump to content

Template:Codesample-header/doc: Difference between revisions

From wikiNonStop
No edit summary
 
m 1 revision imported: Initial Setup
 
(No difference)

Latest revision as of 08:16, 12 April 2026

Usage

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

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