Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » create new module, help

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 484 Views
  • snaip
    Avatar
    Community Member
    180 Posts

    create new module, help Link to this post

    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

    484 Views
Page: 1
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.