Skip to content

Commit 4eaa55c

Browse files
authored
Installing composer require yiisoft/form-model guidance (#228)
1 parent 23f0b9d commit 4eaa55c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

guide/en/start/forms.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ saved in the file `/src/Form/EchoForm.php`:
2525
<?php
2626
namespace App\Form;
2727

28-
class EchoForm
28+
use Yiisoft\FormModel\FormModel;
29+
30+
class EchoForm extends FormModel
2931
{
3032
private string $message = '';
3133

@@ -36,6 +38,12 @@ class EchoForm
3638
}
3739
```
3840

41+
To inherit from `FormModel` you need to install `form-model` by following commands:
42+
43+
```
44+
composer require yiisoft/form-model
45+
```
46+
3947
The `EchoForm` class has `$message` property and related getter.
4048

4149
## Using the form <span id="using-form"></span>
@@ -274,12 +282,6 @@ class EchoForm
274282
{
275283
return $this->message;
276284
}
277-
278-
public function getFormName()
279-
{
280-
return (new \ReflectionClass($this))->getShortName();
281-
}
282-
283285
}
284286
```
285287

0 commit comments

Comments
 (0)