Controller:
$model = new AR类
$this->render("regin",["model"=>$model]);
views 层:
<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\captcha\Captcha;
?>
<?php $form = ActiveForm::begin(['id' => 'login-form']); ?>
<?= $form->field($model, 'user')->label('用户名')->textInput()?>
<div class="form-group">
<?= Html::submitButton('注册') ?>
</div>
<?php ActiveForm::end(); ?>
提交为控制器本方法
详情请看 http://www.yiichina.com