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.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Viewing and Editing Database


Go to End
Reply

9 Posts   961 Views

Avatar
er777

4 August 2011 at 4:50am Community Member, 4 Posts

I've created a form on Silverstripe that works and can be seen as a "submission" on the site. But I need to edit the values on an ongoing basis. I see no way to have an interface that lets me see the data input by the forms in a useable way.

Am I missing something?

Help would be much appreciated.

Avatar
zenmonkey

4 August 2011 at 5:44am Community Member, 528 Posts

If this is a stand alone DataObject you need to create an interface for it using ModelAdmin

http://silverstripe.org/making-a-crm-with-modeladmin-in-silverstripe-230/
http://doc.silverstripe.org/sapphire/en/reference/modeladmin

Or if the dataobject is associated with a specific page you could the DataObjectManager module

Avatar
swaiba

4 August 2011 at 6:47am Forum Moderator, 1796 Posts

Hi,

Are you using the User Forms Module?

Avatar
er777

4 August 2011 at 8:50am (Last edited: 4 August 2011 8:50am), Community Member, 4 Posts

I sure am! And it is working, but the viewing of the data to this point is only obvious on "submissions" - not a normal database view that could be editable..

Avatar
swaiba

4 August 2011 at 8:59am (Last edited: 4 August 2011 8:59am), Forum Moderator, 1796 Posts

well you could do this as a starter...

MyAdmin.php

class MyAdmin extends ModelAdmin {
public static $managed_models = array(
'SubmittedForm',
);
static $url_segment = 'myadmin';
static $menu_title = 'My Admin';
}

Avatar
er777

4 August 2011 at 9:59am Community Member, 4 Posts

Thanks! I am assuming I create a php file named MyAdmin.php and insert that code? Where should it live?

Avatar
swaiba

4 August 2011 at 11:28am Forum Moderator, 1796 Posts

anywhere in mysite (or a folder with a _config.php) - name the file the same as the class name - it will be autoloaded (a nice feature of silverstripe).

Avatar
er777

4 August 2011 at 11:53am Community Member, 4 Posts

Done..thanks!..

Now armed with this info how would I go about displaying the database entries, and allow for their editing also?

Go to Top