我正在尝试将数据加载到表单中。我正在使用 Uncle Cheese 的 bootstrap-forms 模块。据我了解,我通常会调用它,$form->loadDataFrom(Customer::get()->byID(4));
但引导模块以不同的方式构造表单。
//CREATE CUSTOMER FORM
public function CustomerForm() {
return BootstrapForm::create(
$this,
"CustomerForm",
FieldList::create(
TextField::create("Name","Name")
TextField::create("Surname","Surname"),
FieldList::create(
FormAction::create("AddCustomer","Add customer")
->setStyle("success")
),
RequiredFields::create(array("Name","Surname","Tel1", "Address")),
/// I think the load data method should go here but i keep getting errors
BootstrapForm::loadDataFrom(Customer::get()->byID(4)
)
)
}
任何帮助将不胜感激。