验证器的使用代码样例如下: <?php namespace common\models; use Yii; use yii\base\Model; /** * Login form */ class LoginForm extends Model { public $username; public $password; public $rememberMe = true; private $_user; /** * {@inheritdoc} */ public function rules() { ret…