Thread:Project:Support desk/find category of current page/reply (4)

But why use api, when he is in the wanted wiki installation :P

@LTech: You can not call a non static function statically ;) You must create a new instance of WikiPage (or use an existing, i'm unsure, if skin has a instance of WikiPage), for example (untestes): $page = new WikiPage( $title );

Before do that, you must have an Object of Title-Class: &title = Title::newFromText( $wgRequest->getVal( 'title' ) );

After this you can get the Categories from your new WikiPage Object: $categories = $article->getCategories;

In this constellation it's maybe easier (if you don't want to use other functions from WikiPage) to get the categories directly from the Title Object using getparentCategories: $categories = $title->getParentCategories;

The last will return an array with category=>article_title.