简体   繁体   English

从MediaWiki中的URL编码页面名称中获取页面名称

[英]Get page name from URL-encoded page name in MediaWiki

Is there any built in function to get the page name from the page title in MediaWiki. 是否有任何内置函数可以从MediaWiki中的页面标题中获取页面名称。 Example: I have Main_Page and I want Main Page . 示例:我有Main_Page ,我想要Main Page

You should use Title::newFromText to create a new Title object representing the page. 您应该使用Title::newFromText来创建表示页面的新Title对象。 Once you have that, you can use Title::getPrefixedText to get the correct representation of the title meant for displaying it. 一旦你有了,你可以使用Title::getPrefixedText来获得用于显示它的标题的正确表示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM