本文整理匯總了PHP中MWNamespace::subjectEquals方法的典型用法代碼示例。如果您正苦於以下問題:PHP MWNamespace::subjectEquals方法的具體用法?PHP MWNamespace::subjectEquals怎麽用?PHP MWNamespace::subjectEquals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MWNamespace
的用法示例。
在下文中一共展示了MWNamespace::subjectEquals方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: hasSubjectNamespace
/**
* Returns true if the title has the same subject namespace as the
* namespace specified.
* For example this method will take NS_USER and return true if namespace
* is either NS_USER or NS_USER_TALK since both of them have NS_USER
* as their subject namespace.
*
* This is MUCH simpler than individually testing for equivalence
* against both NS_USER and NS_USER_TALK, and is also forward compatible.
* @since 1.19
* @param int $ns
* @return bool
*/
public function hasSubjectNamespace($ns)
{
return MWNamespace::subjectEquals($this->getNamespace(), $ns);
}
示例2: assertDifferentSubject
function assertDifferentSubject($ns1, $ns2, $msg = '')
{
$this->assertFalse(MWNamespace::subjectEquals($ns1, $ns2, $msg));
}