Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
column_set.phtml
Go to the documentation of this file.
1 <?php
7 // @codingStandardsIgnoreFile
8 
9 ?>
10 <?php
15 $numColumns = sizeof($block->getColumns());
16 ?>
17 <?php if ($block->getCollection()): ?>
18  <?php
19  /* This part is commented to remove all <col> tags from the code. */
20  /* foreach ($block->getColumns() as $_column): ?>
21  <col <?= $_column->getHtmlProperty() ?> />
22  <?php endforeach; */ ?>
23  <?php if ($block->isHeaderVisible()): ?>
24  <thead>
25  <?php if ($block->isHeaderVisible() || $block->getFilterVisibility()): ?>
26  <tr>
27  <?php foreach ($block->getColumns() as $_column): ?>
28  <?php /* @var $_column \Magento\Backend\Block\Widget\Grid\Column */ ?>
29  <?php if ($_column->getHeaderHtml() == '&nbsp;'):?>
30  <th class="data-grid-th" data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
31  <?= $_column->getHeaderHtmlProperty() ?>>&nbsp;</th>
32  <?php else: ?>
33  <?= $_column->getHeaderHtml() ?>
34  <?php endif; ?>
35  <?php endforeach; ?>
36  </tr>
37  <?php endif; ?>
38  <?php if ($block->isFilterVisible()): ?>
39  <tr class="data-grid-filters" data-role="filter-form">
40  <?php $i = 0; foreach ($block->getColumns() as $_column): ?>
41  <td data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>" <?= $_column->getHeaderHtmlProperty() ?>>
42  <?= $_column->getFilterHtml() ?>
43  </td>
44  <?php endforeach; ?>
45  </tr>
46  <?php endif ?>
47  </thead>
48  <?php endif; ?>
49 
50  <tbody>
51 
52  <?php if ($block->getCollection()->getSize() > 0 && !$block->getIsCollapsed()): ?>
53  <?php foreach ($block->getCollection() as $_index => $_item): ?>
54  <?php if ($block->hasMultipleRows($_item)) :?>
55  <?php $block->updateItemByFirstMultiRow($_item); ?>
56  <tr title="<?= /* @escapeNotVerified */ $block->getRowUrl($_item) ?>" data-role="row"
57  <?php if ($_class = $block->getRowClass($_item)):?> class="<?= /* @escapeNotVerified */ $_class ?>"<?php endif;?>
58  ><?php $i = 0; foreach ($block->getColumns() as $_column):
59  if ($block->shouldRenderCell($_item, $_column)):
60  $_rowspan = $block->getRowspan($_item, $_column);
61  ?><td data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
62  <?= ($_rowspan ? 'rowspan="' . $_rowspan . '" ' : '') ?>
63  class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?> <?= /* @escapeNotVerified */ $_column->getId() == 'massaction' ? 'data-grid-checkbox-cell': '' ?> <?= ++$i == $numColumns ? 'last' : '' ?>"
64  >
65  <?= (($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?>
66  </td><?php
67  if ($block->shouldRenderEmptyCell($_item, $_column)):?>
68  <td colspan="<?= /* @escapeNotVerified */ $block->getEmptyCellColspan($_item) ?>" class="last">
69  <?= /* @escapeNotVerified */ $block->getEmptyCellLabel() ?>
70  </td><?php
71  endif;
72  endif;
73  endforeach;
74  ?></tr>
75  <?php $_isFirstRow = true; ?>
76  <?php foreach ($block->getMultipleRows($_item) as $_i):?>
77  <?php if ($_isFirstRow) : ?>
78  <?php $_isFirstRow = false; continue; ?>
79  <?php endif; ?>
80  <tr data-role="row">
81  <?php $i = 0; foreach ($block->getMultipleRowColumns($_i) as $_column):
82  ?><td data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
83  class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?> <?= /* @escapeNotVerified */ $_column->getId() == 'massaction' ? 'data-grid-checkbox-cell': '' ?> <?= ++$i == $numColumns-1 ? 'last' : '' ?>"
84  >
85  <?= (($_html = $_column->getRowField($_i)) != '' ? $_html : '&nbsp;') ?>
86  </td><?php
87  endforeach; ?>
88  </tr>
89  <?php endforeach;?>
90 
91  <?php if ($block->shouldRenderSubTotal($_item)): ?>
92  <tr class="subtotals">
93  <?php $i = 0; foreach ($block->getMultipleRowColumns() as $_column): ?>
94  <td data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
95  class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?> <?= /* @escapeNotVerified */ $_column->getId() == 'massaction' ? 'data-grid-checkbox-cell': '' ?> <?= ++$i == $numColumns ? 'last' : '' ?>"
96  >
97  <?php /* @escapeNotVerified */ echo $_column->hasSubtotalsLabel() ? $_column->getSubtotalsLabel()
98  : $_column->getRowField($block->getSubTotals($_item));
99  ?>
100  </td>
101  <?php endforeach; ?>
102  </tr>
103  <?php endif; ?>
104  <?php else: ?>
105  <tr data-role="row" title="<?= /* @escapeNotVerified */ $block->getRowUrl($_item) ?>"<?php if ($_class = $block->getRowClass($_item)):?>
106  class="<?= /* @escapeNotVerified */ $_class ?>"<?php endif;?>
107  >
108  <?php $i = 0; foreach ($block->getColumns() as $_column): ?>
109  <?php if ($block->shouldRenderCell($_item, $_column)):?>
110  <td data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
111  class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?> <?= /* @escapeNotVerified */ $_column->getId() == 'massaction' ? 'data-grid-checkbox-cell': '' ?> <?= ++$i == $numColumns ? 'last' : '' ?>"
112  >
113  <?= (($_html = $_column->getRowField($_item)) != '' ? $_html : '&nbsp;') ?>
114  </td>
115  <?php if ($block->shouldRenderEmptyCell($_item, $_column)):?>
116  <td data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
117  colspan="<?= /* @escapeNotVerified */ $block->getEmptyCellColspan($_item) ?>"
118  class="col-no-records <?= /* @escapeNotVerified */ $block->getEmptyTextClass() ?> last"
119  >
120  <?= /* @escapeNotVerified */ $block->getEmptyCellLabel() ?>
121  </td>
122  <?php endif;?>
123  <?php endif;?>
124  <?php endforeach; ?>
125  </tr>
126  <?php endif; ?>
127  <?php endforeach; ?>
128  <?php elseif ($block->getEmptyText()): ?>
129  <tr class="data-grid-tr-no-data" data-role="row">
130  <td class="<?= /* @escapeNotVerified */ $block->getEmptyTextClass() ?>"
131  colspan="<?= /* @escapeNotVerified */ $numColumns ?>"><?= /* @escapeNotVerified */ $block->getEmptyText() ?></td>
132  </tr>
133  <?php endif; ?>
134  </tbody>
135 
136  <?php if ($block->shouldRenderTotal()): ?>
137  <tfoot>
138  <tr class="totals" data-role="row">
139  <?php foreach ($block->getColumns() as $_column): ?>
140  <th data-column="<?= /* @escapeNotVerified */ $_column->getId() ?>"
141  class="<?= /* @escapeNotVerified */ $_column->getCssProperty() ?>"
142  >
143  <?php /* @escapeNotVerified */ echo($_column->hasTotalsLabel()) ? $_column->getTotalsLabel()
144  : $_column->getRowField($block->getTotals()) ?>
145  </th>
146  <?php endforeach; ?>
147  </tr>
148  </tfoot>
149  <?php endif; ?>
150 <?php endif ?>
$_class
Definition: vat.phtml:13
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
endforeach
endif
$block
Definition: block.php:8
$_isFirstRow
$_count $_index $_prevOptionId if($block->getOrderOptions()|| $_item->getDescription()) foreach( $items as $_item)( $_item) ?><?php $attributes if( $_item->getOrderItem() ->getParentItem())($_prevOptionId !=$attributes['option_id'])</td >< td > & nbsp
Definition: renderer.phtml:33
if($_class=$block->getRowClass($_item)) $i
$_item
Definition: default.phtml:11
$numColumns
if(empty( $_rates))( 'You must first configure currency options before being able to see currency rates.') ?></p ></div ><?php else() ?>"> <? $_i
Definition: matrix.phtml:30