first commit
This commit is contained in:
25
vendor/yiisoft/yii2-bootstrap5/tests/data/ExtendedActiveField.php
vendored
Normal file
25
vendor/yiisoft/yii2-bootstrap5/tests/data/ExtendedActiveField.php
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace yiiunit\extensions\bootstrap5\data;
|
||||
|
||||
use yii\bootstrap5\ActiveField;
|
||||
|
||||
/**
|
||||
* A customized extension from ActiveField
|
||||
*
|
||||
* @see \yiiunit\extensions\bootstrap5\ActiveFieldTest::testHorizontalCssClassesOverride()
|
||||
*
|
||||
* @author Michael Härtl <haertl.mike@gmail.com>
|
||||
*/
|
||||
class ExtendedActiveField extends ActiveField
|
||||
{
|
||||
public $horizontalCssClasses = [
|
||||
'offset' => 'col-md-offset-4',
|
||||
'label' => 'col-md-4',
|
||||
'wrapper' => 'col-md-6',
|
||||
'error' => 'col-md-3',
|
||||
'hint' => 'col-md-3',
|
||||
];
|
||||
}
|
||||
33
vendor/yiisoft/yii2-bootstrap5/tests/data/Singer.php
vendored
Normal file
33
vendor/yiisoft/yii2-bootstrap5/tests/data/Singer.php
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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 [
|
||||
[['lastName'],
|
||||
'default',
|
||||
'value' => 'Lennon'],
|
||||
[['lastName'], 'required'],
|
||||
[['underscore_style'], 'yii\captcha\CaptchaValidator'],
|
||||
[['test'],
|
||||
'required',
|
||||
'when' => function ($model) {
|
||||
return $model->firstName === 'cebe';
|
||||
}],
|
||||
];
|
||||
}
|
||||
}
|
||||
48
vendor/yiisoft/yii2-bootstrap5/tests/data/User.php
vendored
Normal file
48
vendor/yiisoft/yii2-bootstrap5/tests/data/User.php
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* @package yii2-bootstrap5
|
||||
* @author Simon Karlen <simi.albi@outlook.com>
|
||||
*/
|
||||
|
||||
namespace yiiunit\extensions\bootstrap5\data;
|
||||
|
||||
use yii\base\Model;
|
||||
|
||||
class User extends Model
|
||||
{
|
||||
public $id;
|
||||
public $firstName;
|
||||
public $lastName;
|
||||
public $username;
|
||||
public $password;
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
['id', 'integer'],
|
||||
[['firstName', 'lastName'], 'string'],
|
||||
[
|
||||
'username',
|
||||
'string',
|
||||
'min' => 4,
|
||||
],
|
||||
[
|
||||
'password',
|
||||
'string',
|
||||
'min' => 8,
|
||||
'max' => '20',
|
||||
],
|
||||
[['username', 'password'], 'required'],
|
||||
];
|
||||
}
|
||||
|
||||
public function attributeHints()
|
||||
{
|
||||
return [
|
||||
'username' => 'Your username must be at least 4 characters long',
|
||||
'password' => 'Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user