Fix docs: input tabular data, remove unnecessary "-1" (#19489)

Before the change, with this input:
```
$_POST = [
    'Setting' => [
        0 => ['value' => 'value0'],
        1 => ['value' => 'value1'],
    ]
];
```
contents of $settings would be created as follows:
```
$settings = [
    Setting(value='value0'),
];
```
after the change it will be:
```
$settings = [
    Setting(value='value0'),
    Setting(value='value1'),
];
```
This commit is contained in:
Vitalii Rybalko
2022-07-28 23:34:10 +03:00
committed by GitHub
parent 0ad2651914
commit 5eabb93482

View File

@ -92,7 +92,7 @@ public function actionCreate()
{
$settings = [];
if ($this->request->isPost) {
$count = count($this->request->post($setting->tableName())) - 1;
$count = count($this->request->post($setting->tableName()));
for ($i = 0; $i < $count; $i++) {
$settings[$i] = new Setting();
}