Jump to:

23483 Posts in 18965 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » DataObjectDecorator on NewsLetter

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: 635 Views
  • Martijn
    Avatar
    Community Member
    271 Posts

    DataObjectDecorator on NewsLetter Link to this post

    It must be someting very stupid, But i can't get is to work ar the moment.

    <?php

    /*
    * _config.php
    * Object::add_extension('NewsLetter', 'NewsLetterDecorator');
    */   

    class NewsLetterDecorator extends DataObjectDecorator {

       function extraStatics() {
          return array(
             'defaults' => array(
                "Content" => 'test',
             ),
          );
       }
    function populateDefaults(){
          parent::populateDefaults();
          $this->owner->Content ='testtesttest';

       }

    It seems quite solid to me, but nothing happens... Even when I try to remove fields from tab with updateCMSFields() does not work

    What am I missing?

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