Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ModelAdmin remove back button?


Go to End


2 Posts   1286 Views

Avatar
swaiba

Forum Moderator, 1899 Posts

15 February 2011 at 6:14am

Edited: 15/02/2011 7:18am

Hi,

Has anyone got a quick snippet that will remove the 'back' button within ModelAdmin?
It would be very much appreciated

Avatar
swaiba

Forum Moderator, 1899 Posts

17 February 2011 at 3:24am

Edited: 17/02/2011 7:50am

thanks to a little help from simon_w on IRC...

class MyModelAdmin extends ModelAdmin {
...
	public static $record_controller_class = "MyModelAdmins_RecordController";
...
}

class MyModelAdmin_RecordController extends ModelAdmin_RecordController {
...
	public function EditForm() {
		$form = parent::EditForm();
		$fields = $form->Actions();
		$fields->removeByName('action_goBack');
		$form->setActions ($fields);
		return $form;
	}
...
}