跳转到内容

模板:Codesample-header/doc

来自天灾之下:危险连接资料站

Usage

Header for a syntax-highlighted code fragment.

模板参数

此模板首选参数不换行的行内格式。

参数描述类型状态
Title1

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

示例值
includes/specials/SpecialBlankpage.php
字符串必需

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