Skip to content

Nuffic/yii2-docblock-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Usage example

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();

About

Makes a form out of class property docblocks

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages