Template:Codesample-header/doc
This is a documentation subpage for Template:Codesample-header. It contains usage information, categories and other content that is not part of the original Template page. |
This template uses TemplateStyles: |
Usage
editHeader for a syntax-highlighted code fragment.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Title | 1 | Title (name) of this code sample. Often a filename
| String | required |
Example
editThis 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- {{Codesample }}