From 5eabb93482b2fc1fd8784f34eb67c7ed99906e3c Mon Sep 17 00:00:00 2001 From: Vitalii Rybalko Date: Thu, 28 Jul 2022 23:34:10 +0300 Subject: [PATCH] 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'), ]; ``` --- docs/guide/input-tabular-input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/input-tabular-input.md b/docs/guide/input-tabular-input.md index 5a2e0824f9..44c9ffea1d 100644 --- a/docs/guide/input-tabular-input.md +++ b/docs/guide/input-tabular-input.md @@ -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(); }