本文整理汇总了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);
}