nuffic / yii2-docblock-form
There is no license information available for the latest version (1.4.0) of this package.
Makes a form out of class property docblocks
Package info
github.com/Nuffic/yii2-docblock-form
Type:yii2-extension
pkg:composer/nuffic/yii2-docblock-form
1.4.0
2024-10-14 08:28 UTC
Requires
- php: >=7.2
- phpdocumentor/reflection-docblock: ^5.0
- yiisoft/yii2: ^2.0
Requires (Dev)
This package is auto-updated.
Last update: 2026-02-14 11:13:54 UTC
README
Class definition
class Person { /** * @input * @validator {"class": "\\yii\\validators\\RequiredValidator"} * @validator {"class": "\\yii\\validators\\StringValidator", "min": 3, "max": 30} */ public $name; /** * @input widget["kartik\\switchinput\\SwitchInput", {"template": "default"}] * @input {"class": \\yii\\validators\\BooleanValidator", "skipOnEmpty": false} */ public $age; }
Form rendering
$form = ActiveForm::begin(); echo \nuffic\docblock\widget\Configure::widget([ 'form' => $form, 'reflection' => new \nuffic\docblockReflectionBuilder(Person::class), ]); $form->end();