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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Viewing and Editing Database


Go to End


9 Posts   1863 Views

Avatar
er777

Community Member, 4 Posts

4 August 2011 at 4:50am

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

Community Member, 545 Posts

4 August 2011 at 5:44am

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

Forum Moderator, 1899 Posts

4 August 2011 at 6:47am

Hi,

Are you using the User Forms Module?

Avatar
er777

Community Member, 4 Posts

4 August 2011 at 8:50am

Edited: 04/08/2011 8:50am

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

Forum Moderator, 1899 Posts

4 August 2011 at 8:59am

Edited: 04/08/2011 8:59am

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

Community Member, 4 Posts

4 August 2011 at 9:59am

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

Avatar
swaiba

Forum Moderator, 1899 Posts

4 August 2011 at 11:28am

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

Community Member, 4 Posts

4 August 2011 at 11:53am

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