Yii2:是否可以更改搜索中的默认参数名称 URL?
Yii2 : Is it posible to change default parameter name in search URL?
我在下面的搜索 URL 中将 formName/Modal Class Name
更改为 SubjectMaster
到 SM
。
当我 search/filter 数据使用 GET
方法时更改我需要的名称。
如果我理解正确,您需要重写模型上的 formName
方法。
class SubjectMaster extends ...
{
public function formName()
{
return 'SM';
}
}
我在下面的搜索 URL 中将 formName/Modal Class Name
更改为 SubjectMaster
到 SM
。
当我 search/filter 数据使用 GET
方法时更改我需要的名称。
如果我理解正确,您需要重写模型上的 formName
方法。
class SubjectMaster extends ...
{
public function formName()
{
return 'SM';
}
}