我正在添加动态表单字段onChange of dropdown.两种类型的字段都来自不同的模型,并在不同的表中转到数据库.我已经在模型中定义了验证规则.
但验证工作不正常.我的代码如下:
型号:
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "{{%membership_features}}".
*
* @property integer $id
* @property string $title
* @property string $type
* @property integer $is_new
* @property integer $status
* @property integer $is_deleted
* @property string $created_date
* @property string $modified_date
*
* @property MembershipFeaturesValue[] $membershipFeaturesValues
*/
class MembershipFeatures extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public $value=[];
public static function tableName()
{
return '{{%membership_features}}';
}
/**
* …Run Code Online (Sandbox Code Playgroud)