I am trying to load data into a form. I am using the bootstrap-forms module from Uncle Cheese. As i understand it i would normally call $form->loadDataFrom(Customer::get()->byID(4)) but the bootstrap module structures the form differently.
//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))
)
}
Any help will be appreciated