* Evgeny Fadeev evgeny.fadeev@gmail.com [Mon, 22 Feb 2010 12:23:20 -0800]:
Hello,
here is what I would like to accomplish:
somesite.net/<namespace>/<page_name[/subpage]>[?optional parameters]
Is there a way to achieve that?
Thank you and best regards,
Hi Evgeny! Take a look at the code of includes/SpecialPage.php, methods (from v1.15.1 I just use) static function executePath( &$title, $including = false ) { global $wgOut, $wgTitle, $wgRequest; wfProfileIn( __METHOD__ );
# FIXME: redirects broken due to this call $bits = explode( '/', $title->getDBkey(), 2 ); $name = $bits[0]; if( !isset( $bits[1] ) ) { // bug 2087 $par = NULL; } else { $par = $bits[1]; } ...skip... // Execute special page $profName = 'Special:' . $page->getName(); wfProfileIn( $profName ); $page->execute( $par ); $page->execute( $par ); wfProfileOut( $profName ); wfProfileOut( __METHOD__ ); return true; } That $par is a parameter after slash, passed to execute() method. If you want to build your own special page, which may take it's parameter from "slash subpage" string, you have simply to extend SpecialPage class and implement your function execute(). If you want to use such parameter somewhere else, you probably have to use Title::getSubpageText(). Request query parameters (after '?') can be obtained by using $wgRequest instance of WebRequest object methods getInt('paramname'), getCheck('paramname'), getText('paramname'). Dmitriy