For those who are still looking for the answer, this is how I solve it:
Add public variable and overwrite the formName by the variable:
class ModelSearch extends Model {
public $formNameParam = "ModelSearch";
/**
* @return string — the form name of this model class.
*/
public function formName() {
return $this->formNameParam;
}
In your controller, you just need to assign whatever the name you want:
$searchModel = new ModelSearch(["formNameParam" => "FirstModelSearch"]);
Thanks for the answer, back then i am very new to yii, dont even know how to read the docs properly. Back then i think i solve it by modifying each of the search input name in the gridview configuration. After that, other project does not require to has multiple gridview of same model in same page, so i never look for easier solution. I has just check the doc, your solution is the proper one, thanks again.