hey guys,
i get this error:
Notice: Undefined variable: form in /srv/www/vhosts/domain.de/subdomains/sifa/httpdocs/mysite/code/MUPage.php on line 68 Fatal error: Call to a member function saveInto() on a non-object in /srv/www/vhosts/marketingundpartner.de/subdomains/sifa/httpdocs/mysite/code/MUPage.php on line 68
and this is the code of my form:
<?php
class MUPage extends Page {
static $db = array(
);
static $has_one = array(
);
static $defaults = array(
);
}
class MUPage_Controller extends Page_Controller {
function init() {
parent::init();
// Requirements::themedCSS("memberupload");
}
function AlbumCreateForm() {
$fieldset = new FieldSet(
new TextField(
$name = "Name",
$title = "Albumname",
$value = ""
),
new TextareaField(
$name = "Desc",
$title = "Beschreibung",
$rows = 8,
$cols = 3,
$value = ""
),
new HiddenField (
$name = "Status",
$title= "status",
$value = "0"
),
new HiddenField (
$name = "OwnerID",
$title= "test",
$value = Member::currentUserID()
),
new HiddenField (
$name = "Date",
$title= "Datum",
$value = time()
)
);
$actions = new FieldSet(
new FormAction('AlbumCreate', 'Erstellen')
);
return new Form($this, 'AlbumSenden', $fieldset, $actions);
}
function AlbumSenden($data, $form) {
$submission = new MUAlbum();
$form->saveInto($submission);
$submission->write();
Director::redirectBack();
}
}
?>
THE FORM IS SHOWN, I GET THE ERROR AFTER CLICKING THE SEND BUTTON..
hmm.. i already did many form like this.. i cant find the error. Why the error says: "Notice: Undefined variable: form... ..."
Why is FORM undefined?