mirror of
https://github.com/silverstripe/silverstripe-frameworktest
synced 2024-10-22 11:06:02 +02:00
Added test button for ImageFormAction
This commit is contained in:
parent
9998db2e9e
commit
1df4995f00
@ -41,7 +41,10 @@ class TestPage_Controller extends Page_Controller {
|
||||
*/
|
||||
function Form() {
|
||||
$fields = $this->getCMSFields();
|
||||
$actions = new FieldSet(new FormAction("save", "Save"));
|
||||
$actions = new FieldSet(
|
||||
new FormAction("save", "Save"),
|
||||
new ImageFormAction("gohome", "Go home", "frameworktest/images/test-button.png")
|
||||
);
|
||||
$form = new Form($this, "Form", $fields, $actions);
|
||||
$form->loadDataFrom($this->dataRecord);
|
||||
return $form;
|
||||
@ -53,6 +56,10 @@ class TestPage_Controller extends Page_Controller {
|
||||
Director::redirectBack();
|
||||
}
|
||||
|
||||
function gohome() {
|
||||
Director::redirect("./");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a bunch of pages
|
||||
*/
|
||||
|
BIN
images/test-button.png
Normal file
BIN
images/test-button.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
Loading…
Reference in New Issue
Block a user