문제

I'm developing a MediaWiki skin, and one of the elements I would like to use is the article URL-encoded title as the element ID or Class for styling purposes. I need help implementing this example:

This example

도움이 되었습니까?

해결책

Assuming that you are within the execute function of your skin, you ca access the title object like this:

$title = $this->data['skin']->getTitle();

Then you can get the URL enocoded title like this:

$URLEncodedTitle = $title->getPartialURL();


If you are in the initPage function, use

$title = $this->getTitle();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top