1. Go to this page and download the library: Download flaviovs/yii2-form library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
flaviovs / yii2-form example snippets
class MyForm extends fv\yii\form\Model
{
/** @var \app\models\Post */
public $post;
/** @var \app\models\Comment */
public $comment;
}
protected function modelAttributes()
{
return ['post', 'comment'];
}
protected function rules()
{
return [
[$this->modelAttributes(), 'safe'];
];
}