public function Form()
    {
        if ($this->currentRecord) {
            $fields = $this->currentRecord->getFrontEndFields();
            $required = $this->currentRecord->getRequiredFields();
        } else {
            $fields = singleton($this->recordType)->getFrontEndFields();
            $required = singleton($this->recordType)->getFrontEndFields();
        }

        $fields->push(new HiddenField('ID'));
        $form = new Form($this, __function__, $fields, new FieldList(new FormAction('doSave', 'Save')), $required);
        if ($this->currentRecord) {
            $form->loadDataFrom($this->currentRecord);
        }
        return $form;
    }
public function Form()
    {
        if ($this->currentRecord) {
            $fields = $this->currentRecord->getFrontEndFields();
            $required = $this->currentRecord->getRequiredFields();
        } else {
            $fields = singleton($this->recordType)->getFrontEndFields();
            $required = singleton($this->recordType)->getFrontEndFields();
        }

        $fields->push(new HiddenField('ID'));
        $form = new Form($this, __function__, $fields, new FieldList(new FormAction('doSave', 'Save')), $required);
        if ($this->currentRecord) {
            $form->loadDataFrom($this->currentRecord);
        }
        return $form;
    }
public function Form ( ) { if ( $ this -> currentRecord ) { $ fields = $ this -> currentRecord -> getFrontEndFields ( ) ; $ required = $ this -> currentRecord -> getRequiredFields ( ) ; } else { $ fields = singleton ( $ this -> recordType ) -> getFrontEndFields ( ) ; $ required = singleton ( $ this -> recordType ) -> getFrontEndFields ( ) ; } $ fields -> push ( new HiddenField ( 'ID' ) ) ; $ form = new Form ( $ this , __function__ , $ fields , new FieldList ( new FormAction ( 'doSave' , 'Save' ) ) , $ required ) ; if ( $ this -> currentRecord ) { $ form -> loadDataFrom ( $ this -> currentRecord ) ; } return $ form ; }
Scaffolds the fields required for editing the record

@return Form
Scaffolds the fields required for editing the record