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