Jump to:

22977 Posts in 11720 Topics by 2826 members

General Questions

SilverStripe Forums » General Questions » DataObject

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
Go to End
Author Topic: 534 Views
  • bebabeba
    Avatar
    Community Member
    192 Posts

    DataObject Link to this post

    I read documentation but is not clear the difference between extends Page and extends DataObject when i create a new class.
    If I create a new page type what I must use?

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: DataObject Link to this post

    extending Page is what you want.

    when you extend Page, you get the stuff from DataObject.

    I suggest you read this... http://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)

  • Willr
    Avatar
    Forum Moderator
    5462 Posts

    Re: DataObject Link to this post

    Page extends SiteTree which extends DataObject. So you get all the functionality of dataobjects in your Page objects with a ton of stuff from SiteTree http://api.silverstripe.org/2.4/cms/SiteTree.html sometimes this is useful (say for page types in the cms - where you want to extend page) and sometimes its not so useful (eg in this forum, each post is a dataobject since no need to 'create' it as a page).

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