Initial commit,修正
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace yiiunit\extensions\bootstrap5\data;
|
||||
|
||||
use yii\base\Model;
|
||||
|
||||
/**
|
||||
* Class Singer
|
||||
*
|
||||
* @author Daniel Gomez Pan <pana_1990@hotmail.com>
|
||||
*/
|
||||
class Singer extends Model
|
||||
{
|
||||
public $firstName;
|
||||
public $lastName;
|
||||
public $test;
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['lastName'], 'default', 'value' => 'Lennon'],
|
||||
[['lastName'], 'required'],
|
||||
[['underscore_style'], 'yii\captcha\CaptchaValidator'],
|
||||
[['test'], 'required', 'when' => function ($model) {
|
||||
return $model->firstName === 'cebe';
|
||||
}],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user