10/01/2012 11:15am

PHP | Problem -


function edit() {

if(Permission::check('MARKET_EDIT')) {
$dataobject = DataObject::get_one('Market',"ID=".(int)$this->Params['ID']);

$form = $this->editForm();
$form->loadDataFrom($dataobject);
$data = array(
'Market' => "echo",
'Form' => $form
);
return $this->customise($data);
} else {
Security::permissionFailure();
//Director::redirect(Director::baseURL());
}
}

function editForm() {

$actions = new FieldSet(
new FormAction('edit_save', 'Save')
);
$form = new Form($this, __FUNCTION__, singleton('Market')->getFrontEndFields(), $actions);
return $form;
}

function edit_save($data,$form) {
var_dump($this->Params);
#var_dump($this->Params);
#var_dump($data);
#var_dump($form);
exit;
$myPlayer = DataObject::get_one('Market','ID=');
if($myPlayer) {
$form->saveInto($myPlayer);
$myPlayer->write();
$form->addErrorMessage("Blurb",'Ihre Änderungen wurden gespeichert',"good");
}
return Director::redirectBack();
}


Post Comment