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.

All other Modules /

Discuss all other Modules here.

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

create new module, help


Go to End


783 Views

Avatar
snaip

Community Member, 181 Posts

20 January 2011 at 7:50am

hi

i try to create new module , it is very simple: add references

so i create new folder /references width subfolders /code /css/ templates and _config.php file

in subfolder /code i have two files

References.php
ReferencesAdmin.php

class References extends DataObject {

    public static $db = array(
        'Name' => 'Varchar(255)',
        'Content' => 'Text',
        'Status' => 'Enum("New, Active, Disable","New")'
    );


    public static $summary_fields = array(
        'Name',
        'Content',
        'Stauts'
    );

}

class ReferencesAdmin extends ModelAdmin {

	public static $menu_title = 'References';

	public static $url_segment = 'references';

	public static $managed_models = 'References';

	public static $model_importers = array();

}

and it works fine
on left side menu i have small (default) search form

but how to set default action to list all references? thirst i have to search all references to get results but i want to get all references on start action