-
-
Save wilr/f478f6a7873492433e71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TestAdmin extends LeftAndMain { | |
private static $url_segment = 'test'; | |
function getEditForm($id = NULL, $fields = NULL) { | |
return Form::create( | |
$this, | |
'EditForm', | |
new FieldList( | |
new TextField('Name') | |
), | |
new FieldList( | |
FormAction::create('doSubmit') | |
) | |
) | |
// JS and CSS use this identifier | |
->setHTMLID('Form_EditForm') | |
// Required for correct CMS layout | |
->addExtraClass('cms-edit-form') | |
->setTemplate($this->getTemplatesWithSuffix('_EditForm')); | |
} | |
public function doSubmit($data, $form) { | |
return "<h1>Hi</h1>"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment