當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DiffusionRequest::getCallsign方法代碼示例

本文整理匯總了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;
 }
開發者ID:hrb518,項目名稱:phabricator,代碼行數:18,代碼來源:DiffusionBrowseController.php

示例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);
 }
開發者ID:rudimk,項目名稱:phabricator,代碼行數:18,代碼來源:DiffusionBrowseFileController.php


注:本文中的DiffusionRequest::getCallsign方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。