pana1990
10 years ago
4 changed files with 66 additions and 4 deletions
@ -0,0 +1,27 @@
|
||||
<?php |
||||
|
||||
namespace yiiunit\extensions\bootstrap\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'; }], |
||||
]; |
||||
} |
||||
} |
Loading…
Reference in new issue