本文整理匯總了PHP中PhabricatorApplicationSearchEngine::renderNewUserView方法的典型用法代碼示例。如果您正苦於以下問題:PHP PhabricatorApplicationSearchEngine::renderNewUserView方法的具體用法?PHP PhabricatorApplicationSearchEngine::renderNewUserView怎麽用?PHP PhabricatorApplicationSearchEngine::renderNewUserView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PhabricatorApplicationSearchEngine
的用法示例。
在下文中一共展示了PhabricatorApplicationSearchEngine::renderNewUserView方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderNewUserView
private function renderNewUserView(PhabricatorApplicationSearchEngine $engine, $force_nux)
{
// Don't render NUX if the user has clicked away from the default page.
if (strlen($this->getQueryKey())) {
return null;
}
// Don't put NUX in panels because it would be weird.
if ($engine->isPanelContext()) {
return null;
}
// Try to render the view itself first, since this should be very cheap
// (just returning some text).
$nux_view = $engine->renderNewUserView();
if (!$nux_view) {
return null;
}
$query = $engine->newQuery();
if (!$query) {
return null;
}
// Try to load any object at all. If we can, the application has seen some
// use so we just render the normal view.
if (!$force_nux) {
$object = $query->setViewer(PhabricatorUser::getOmnipotentUser())->setLimit(1)->execute();
if ($object) {
return null;
}
}
return $nux_view;
}