Hi,
I am newbee to yii2 and I’m using yii2 advanced framework I have made a custom search form for a page and the form includes the field that is required while creating or updating(rule added in model as required) and another field that is normal field(not a require field on creation/insert).
When I click on search button it’s showing feild1 is required.I need by search form in such a way that I can filter with field1 or field2.
I may be wrong somewhere please advice me on the above concern.
Here is my model class rule function
public function rules()
{
return [
[['field1'], 'required'],
[['inserted_date', 'updated_date', 'is_deleted','is_active'], 'integer'],
[['field1'], 'string', 'max' => 255],
[['field2', 'field3', 'field4', 'field5'], 'string', 'max' => 50],
];
}
Thanks In advance