本文整理匯總了PHP中AphrontTableView::setClassName方法的典型用法代碼示例。如果您正苦於以下問題:PHP AphrontTableView::setClassName方法的具體用法?PHP AphrontTableView::setClassName怎麽用?PHP AphrontTableView::setClassName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AphrontTableView
的用法示例。
在下文中一共展示了AphrontTableView::setClassName方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: render
public function render()
{
$data = $this->getData();
$rows = array();
$details = '';
foreach ($data as $index => $row) {
$file = $row['file'];
$line = $row['line'];
$tag = phutil_render_tag('a', array('onclick' => jsprintf('show_details(%d)', $index)), phutil_escape_html($row['str'] . ' at [' . basename($file) . ':' . $line . ']'));
$rows[] = array($tag);
$details .= '<div class="dark-console-panel-error-details" id="row-details-' . $index . '">' . phutil_escape_html($row['details']) . "\n" . 'Stack trace:' . "\n";
foreach ($row['trace'] as $key => $entry) {
$line = '';
if (isset($entry['class'])) {
$line .= $entry['class'] . '::';
}
$line .= idx($entry, 'function', '');
$onclick = '';
if (isset($entry['file'])) {
$line .= ' called at [' . $entry['file'] . ':' . $entry['line'] . ']';
$onclick = jsprintf('open_file(%s, %d)', $entry['file'], $entry['line']);
}
$details .= phutil_render_tag('a', array('onclick' => $onclick), phutil_escape_html($line));
$details .= "\n";
}
$details .= '</div>';
}
$table = new AphrontTableView($rows);
$table->setClassName('error-log');
$table->setHeaders(array('Error'));
$table->setNoDataString('No errors.');
return '<div>' . '<div>' . $table->render() . '</div>' . '<div class="dark-console-panel-error-separator"></div>' . '<pre class="PhabricatorMonospaced">' . $details . '</pre>' . '</div>';
}
示例2: renderPanel
public function renderPanel()
{
$data = $this->getData();
$rows = array();
$details = array();
foreach ($data as $index => $row) {
$file = $row['file'];
$line = $row['line'];
$tag = phutil_tag('a', array('onclick' => jsprintf('show_details(%d)', $index)), $row['str'] . ' at [' . basename($file) . ':' . $line . ']');
$rows[] = array($tag);
$details[] = hsprintf('<div class="dark-console-panel-error-details" id="row-details-%s">' . "%s\nStack trace:\n", $index, $row['details']);
foreach ($row['trace'] as $key => $entry) {
$line = '';
if (isset($entry['class'])) {
$line .= $entry['class'] . '::';
}
$line .= idx($entry, 'function', '');
$href = null;
if (isset($entry['file'])) {
$line .= ' called at [' . $entry['file'] . ':' . $entry['line'] . ']';
try {
$user = $this->getRequest()->getUser();
$href = $user->loadEditorLink($entry['file'], $entry['line'], '');
} catch (Exception $ex) {
// The database can be inaccessible.
}
}
$details[] = phutil_tag('a', array('href' => $href), $line);
$details[] = "\n";
}
$details[] = hsprintf('</div>');
}
$table = new AphrontTableView($rows);
$table->setClassName('error-log');
$table->setHeaders(array('Error'));
$table->setNoDataString('No errors.');
return phutil_tag('div', array(), array(phutil_tag('div', array(), $table->render()), phutil_tag('pre', array('class' => 'PhabricatorMonospaced'), $details)));
}