本文整理匯總了PHP中AphrontTableView::setDeviceReadyTable方法的典型用法代碼示例。如果您正苦於以下問題:PHP AphrontTableView::setDeviceReadyTable方法的具體用法?PHP AphrontTableView::setDeviceReadyTable怎麽用?PHP AphrontTableView::setDeviceReadyTable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AphrontTableView
的用法示例。
在下文中一共展示了AphrontTableView::setDeviceReadyTable方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
public function render()
{
$logs = $this->logs;
$viewer = $this->getUser();
$view = new PHUIObjectItemListView();
$rows = array();
foreach ($logs as $log) {
$resource_uri = '/drydock/resource/' . $log->getResourceID() . '/';
$lease_uri = '/drydock/lease/' . $log->getLeaseID() . '/';
$rows[] = array(phutil_tag('a', array('href' => $resource_uri), $log->getResourceID()), phutil_tag('a', array('href' => $lease_uri), $log->getLeaseID()), $log->getMessage(), phabricator_date($log->getEpoch(), $viewer));
}
$table = new AphrontTableView($rows);
$table->setDeviceReadyTable(true);
$table->setHeaders(array(pht('Resource'), pht('Lease'), pht('Message'), pht('Date')));
$table->setShortHeaders(array('R', 'L', pht('Message'), ''));
$table->setColumnClasses(array('', '', 'wide', ''));
return $table;
}
示例2: buildHumanReadableResponse
private function buildHumanReadableResponse($method, ConduitAPIRequest $request = null, $result = null)
{
$param_rows = array();
$param_rows[] = array('Method', $this->renderAPIValue($method));
if ($request) {
foreach ($request->getAllParameters() as $key => $value) {
$param_rows[] = array($key, $this->renderAPIValue($value));
}
}
$param_table = new AphrontTableView($param_rows);
$param_table->setDeviceReadyTable(true);
$param_table->setColumnClasses(array('header', 'wide'));
$result_rows = array();
foreach ($result as $key => $value) {
$result_rows[] = array($key, $this->renderAPIValue($value));
}
$result_table = new AphrontTableView($result_rows);
$result_table->setDeviceReadyTable(true);
$result_table->setColumnClasses(array('header', 'wide'));
$param_panel = new AphrontPanelView();
$param_panel->setHeader('Method Parameters');
$param_panel->appendChild($param_table);
$result_panel = new AphrontPanelView();
$result_panel->setHeader('Method Result');
$result_panel->appendChild($result_table);
$param_head = id(new PHUIHeaderView())->setHeader(pht('Method Parameters'));
$result_head = id(new PHUIHeaderView())->setHeader(pht('Method Result'));
$method_uri = $this->getApplicationURI('method/' . $method . '/');
$crumbs = $this->buildApplicationCrumbs()->addTextCrumb($method, $method_uri)->addTextCrumb(pht('Call'));
return $this->buildApplicationPage(array($crumbs, $param_head, $param_table, $result_head, $result_table), array('title' => 'Method Call Result'));
}