Skip to content

Instantly share code, notes, and snippets.

@dantman
Created October 2, 2011 15:29
Show Gist options
  • Save dantman/1257541 to your computer and use it in GitHub Desktop.
Save dantman/1257541 to your computer and use it in GitHub Desktop.
<?php
class SpecialTitleTargeted extends SpecialPage implements SpecialTitleTarget {
function executeWithTarget() {
$this->getOutput()->addHTML( htmlspecialchars(
$this->target()->getPrefixedText() ) );
}
}
class SpecialUserTargeted extends SpecialPage implements SpecialUserTarget {
function executeWithTarget() {
$this->getOutput()->addHTML( htmlspecialchars(
$this->target()->getName() ) );
}
}
// Special:TitleTargeted/Foo
# Foo
// Special:UserTargeted/Dantman
# Dantman
// Special:TitleTargeted
# [form asking for a title]
// Special:UserTargeted
# [form asking for a username]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment