21293 Posts in 5733 Topics by 2602 members
| Go to End | Next > | |
| Author | Topic: | 616 Views |
-
Viewing and Editing Database

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.
-
Re: Viewing and Editing Database

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/modeladminOr if the dataobject is associated with a specific page you could the DataObjectManager module
-
Re: Viewing and Editing Database

4 August 2011 at 8:50am Last edited: 4 August 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..
-
Re: Viewing and Editing Database

4 August 2011 at 8:59am Last edited: 4 August 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';
} -
Re: Viewing and Editing Database

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?
-
Re: Viewing and Editing Database

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).
-
Re: Viewing and Editing Database

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?
| 616 Views | ||
| Go to Top | Next > |



