当前位置: 首页>>代码示例>>PHP>>正文


PHP AphrontTableView::setClassName方法代码示例

本文整理汇总了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>';
 }
开发者ID:ramons03,项目名称:phabricator,代码行数:33,代码来源:DarkConsoleErrorLogPlugin.php

示例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)));
 }
开发者ID:denghp,项目名称:phabricator,代码行数:38,代码来源:DarkConsoleErrorLogPlugin.php


注:本文中的AphrontTableView::setClassName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。