本文整理匯總了PHP中PHUIPropertyListView::setStacked方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHUIPropertyListView::setStacked方法的具體用法?PHP PHUIPropertyListView::setStacked怎麽用?PHP PHUIPropertyListView::setStacked使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHUIPropertyListView
的用法示例。
在下文中一共展示了PHUIPropertyListView::setStacked方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildObjectTranscriptPanel
private function buildObjectTranscriptPanel(HeraldTranscript $xscript)
{
$adapter = $this->getAdapter();
$field_names = $adapter->getFieldNameMap();
$object_xscript = $xscript->getObjectTranscript();
$data = array();
if ($object_xscript) {
$phid = $object_xscript->getPHID();
$handles = $this->handles;
$data += array(pht('Object Name') => $object_xscript->getName(), pht('Object Type') => $object_xscript->getType(), pht('Object PHID') => $phid, pht('Object Link') => $handles[$phid]->renderLink());
}
$data += $xscript->getMetadataMap();
if ($object_xscript) {
foreach ($object_xscript->getFields() as $field => $value) {
$field = idx($field_names, $field, '[' . $field . '?]');
$data['Field: ' . $field] = $value;
}
}
$rows = array();
foreach ($data as $name => $value) {
if (!$value instanceof PhutilSafeHTML) {
if (!is_scalar($value) && !is_null($value)) {
$value = implode("\n", $value);
}
if (strlen($value) > 256) {
$value = phutil_tag('textarea', array('class' => 'herald-field-value-transcript'), $value);
}
}
$rows[] = array($name, $value);
}
$property_list = new PHUIPropertyListView();
$property_list->setStacked(true);
foreach ($rows as $row) {
$property_list->addProperty($row[0], $row[1]);
}
$box = new PHUIObjectBoxView();
$box->setHeaderText(pht('Object Transcript'));
$box->appendChild($property_list);
return $box;
}