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