44 private $_arrayRowsCache;
56 protected $_template =
'Magento_Config::system/config/form/field/array.phtml';
65 if (!$this->_addButtonLabel) {
66 $this->_addButtonLabel =
__(
'Add');
80 $this->_columns[
$name] = [
88 &&
$params[
'renderer'] instanceof \
Magento\Framework\View\Element\AbstractBlock
90 $this->_columns[
$name][
'renderer'] =
$params[
'renderer'];
104 return empty(
$params[$paramName]) ? $defaultValue :
$params[$paramName];
117 $this->_arrayRowsCache =
null;
141 public function getArrayRows()
143 if (
null !== $this->_arrayRowsCache) {
144 return $this->_arrayRowsCache;
151 $rowColumnValues = [];
156 $row[
'_id'] = $rowId;
157 $row[
'column_values'] = $rowColumnValues;
158 $result[$rowId] = new \Magento\Framework\DataObject(
$row);
162 $this->_arrayRowsCache =
$result;
163 return $this->_arrayRowsCache;
175 return $rowId .
'_' . $columnName;
186 return $this->getElement()->getName() .
'[<%- _id %>][' . $columnName .
']';
198 if (empty($this->_columns[$columnName])) {
199 throw new \Exception(
'Wrong column name specified.');
201 $column = $this->_columns[$columnName];
204 if ($column[
'renderer']) {
205 return $column[
'renderer']->setInputName(
226 ($column[
'size'] ?
'size="' .
230 (isset($column[
'class'])
232 :
'input-text') .
'"' . (isset($column[
'style']) ?
' style="' . $column[
'style'] .
'"' :
'') .
'/>';
253 if (!$this->_isPreparedToRender) {
255 $this->_isPreparedToRender =
true;
257 if (empty($this->_columns)) {
258 throw new \Exception(
'At least one column must be defined.');
260 return parent::_toHtml();
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
if(!isset($_GET['name'])) $name