demo-pathology/vendor/yiisoft/yii2-bootstrap5/tests/data/Singer.php

34 lines
698 B
PHP
Raw Normal View History

2025-12-26 03:03:19 +00:00
<?php
2026-01-09 10:35:33 +00:00
declare(strict_types=1);
2025-12-26 03:03:19 +00:00
namespace yiiunit\extensions\bootstrap5\data;
use yii\base\Model;
/**
* @author Daniel Gomez Pan <pana_1990@hotmail.com>
*/
class Singer extends Model
{
public $firstName;
public $lastName;
public $test;
public function rules()
{
return [
2026-01-09 10:35:33 +00:00
[['lastName'],
'default',
'value' => 'Lennon'],
2025-12-26 03:03:19 +00:00
[['lastName'], 'required'],
[['underscore_style'], 'yii\captcha\CaptchaValidator'],
2026-01-09 10:35:33 +00:00
[['test'],
'required',
'when' => function ($model) {
return $model->firstName === 'cebe';
}],
2025-12-26 03:03:19 +00:00
];
}
}