本文整理匯總了PHP中DiffusionRequest::getCallsign方法的典型用法代碼示例。如果您正苦於以下問題:PHP DiffusionRequest::getCallsign方法的具體用法?PHP DiffusionRequest::getCallsign怎麽用?PHP DiffusionRequest::getCallsign使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DiffusionRequest
的用法示例。
在下文中一共展示了DiffusionRequest::getCallsign方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildActionView
protected function buildActionView(DiffusionRequest $drequest)
{
$viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView())->setUser($viewer);
$history_uri = $drequest->generateURI(array('action' => 'history'));
$view->addAction(id(new PhabricatorActionView())->setName(pht('View History'))->setHref($history_uri)->setIcon('fa-list'));
$behind_head = $drequest->getSymbolicCommit();
$head_uri = $drequest->generateURI(array('commit' => '', 'action' => 'browse'));
$view->addAction(id(new PhabricatorActionView())->setName(pht('Jump to HEAD'))->setHref($head_uri)->setIcon('fa-home')->setDisabled(!$behind_head));
// TODO: Ideally, this should live in Owners and be event-triggered, but
// there's no reasonable object for it to react to right now.
$owners = 'PhabricatorOwnersApplication';
if (PhabricatorApplication::isClassInstalled($owners)) {
$owners_uri = id(new PhutilURI('/owners/view/search/'))->setQueryParams(array('repository' => $drequest->getCallsign(), 'path' => '/' . $drequest->getPath()));
$view->addAction(id(new PhabricatorActionView())->setName(pht('Find Owners'))->setHref((string) $owners_uri)->setIcon('fa-users'));
}
return $view;
}
示例2: renderBrowse
private static function renderBrowse(DiffusionRequest $drequest, $path, $name = null, $rev = null, $line = null, $view = null, $title = null)
{
$callsign = $drequest->getCallsign();
if ($name === null) {
$name = $path;
}
$at = null;
if ($rev) {
$at = ';' . $rev;
}
if ($view) {
$view = '?view=' . $view;
}
if ($line) {
$line = '$' . $line;
}
return phutil_render_tag('a', array('href' => "/diffusion/{$callsign}/browse/{$path}{$at}{$line}{$view}", 'title' => $title), $name);
}