如何更改Gridfield
添加按钮的默认按钮文字?
我想这与->getConfig()
有关,有什么想法吗?
答案 0 :(得分:5)
通过以下示例之一更改“网格域添加”按钮的默认按钮文本:
//$gridfield = ..... // define you gridfield as normal first...then
$gridfield->getConfig()->getComponentByType('GridFieldAddNewButton')->setButtonName('Add Extra Product Gallery Images');
或者将其添加到您的数据对象:
static $singular_name = "Add Extra Product Gallery Image";
static $plural_name = "Add Extra Product Gallery Images";