當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TableStyle::getCellRowFormat方法代碼示例

本文整理匯總了PHP中Symfony\Component\Console\Helper\TableStyle::getCellRowFormat方法的典型用法代碼示例。如果您正苦於以下問題:PHP TableStyle::getCellRowFormat方法的具體用法?PHP TableStyle::getCellRowFormat怎麽用?PHP TableStyle::getCellRowFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Console\Helper\TableStyle的用法示例。


在下文中一共展示了TableStyle::getCellRowFormat方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: render

 /**
  * Renders table to output.
  *
  * Example:
  * +---------------+-----------------------+------------------+
  * | ISBN          | Title                 | Author           |
  * +---------------+-----------------------+------------------+
  * | 99921-58-10-7 | Divine Comedy         | Dante Alighieri  |
  * | 9971-5-0210-0 | A Tale of Two Cities  | Charles Dickens  |
  * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
  * +---------------+-----------------------+------------------+
  */
 public function render()
 {
     $this->calculateNumberOfColumns();
     $rows = $this->buildTableRows($this->rows);
     $headers = $this->buildTableRows($this->headers);
     $this->calculateColumnsWidth(array_merge($headers, $rows));
     $this->renderRowSeparator();
     if (!empty($headers)) {
         foreach ($headers as $header) {
             $this->renderRow($header, $this->style->getCellHeaderFormat());
             $this->renderRowSeparator();
         }
     }
     foreach ($rows as $row) {
         if ($row instanceof TableSeparator) {
             $this->renderRowSeparator();
         } else {
             $this->renderRow($row, $this->style->getCellRowFormat());
         }
     }
     if (!empty($rows)) {
         $this->renderRowSeparator();
     }
     $this->cleanup();
 }
開發者ID:ABaldwinHunter,項目名稱:symfony-clone,代碼行數:37,代碼來源:Table.php

示例2: render

 /**
  * Renders table to output.
  *
  * Example:
  * +---------------+-----------------------+------------------+
  * | ISBN          | Title                 | Author           |
  * +---------------+-----------------------+------------------+
  * | 99921-58-10-7 | Divine Comedy         | Dante Alighieri  |
  * | 9971-5-0210-0 | A Tale of Two Cities  | Charles Dickens  |
  * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien |
  * +---------------+-----------------------+------------------+
  */
 public function render()
 {
     $this->renderRowSeparator();
     $this->renderRow($this->headers, $this->style->getCellHeaderFormat());
     if (!empty($this->headers)) {
         $this->renderRowSeparator();
     }
     foreach ($this->rows as $row) {
         if ($row instanceof TableSeparator) {
             $this->renderRowSeparator();
         } else {
             $this->renderRow($row, $this->style->getCellRowFormat());
         }
     }
     if (!empty($this->rows)) {
         $this->renderRowSeparator();
     }
     $this->cleanup();
 }
開發者ID:EnmanuelCode,項目名稱:backend-laravel,代碼行數:31,代碼來源:Table.php


注:本文中的Symfony\Component\Console\Helper\TableStyle::getCellRowFormat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。