模板:Codesample-header/doc
外观
| 文件:Codex icon book color-base.svg | This is a documentation subpage for 模板:Codesample-header. It contains usage information, categories and other content that is not part of the original 模板 page. |
| CSS | This template uses TemplateStyles: |
Usage
Header for a syntax-highlighted code fragment.
| 参数 | 描述 | 类型 | 状态 | |
|---|---|---|---|---|
| Title | 1 | Title (name) of this code sample. Often a filename
| 字符串 | 必需 |
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
- {{Codesample}}