Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » Viewing and Editing Database

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

Page: 1 2
Go to End
Author Topic: 808 Views
  • er777
    Avatar
    Community Member
    4 Posts

    Viewing and Editing Database Link to this post

    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.

  • zenmonkey
    Avatar
    Community Member
    524 Posts

    Re: Viewing and Editing Database Link to this post

    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

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Viewing and Editing Database Link to this post

    Hi,

    Are you using the User Forms Module?

  • er777
    Avatar
    Community Member
    4 Posts

    Re: Viewing and Editing Database Link to this post

    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..

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Viewing and Editing Database Link to this post

    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';
    }

  • er777
    Avatar
    Community Member
    4 Posts

    Re: Viewing and Editing Database Link to this post

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

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Viewing and Editing Database Link to this post

    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).

  • er777
    Avatar
    Community Member
    4 Posts

    Re: Viewing and Editing Database Link to this post

    Done..thanks!..

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

    808 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.