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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

DataObjectDecorator on NewsLetter


Go to End


938 Views

Avatar
Martijn

Community Member, 271 Posts

6 September 2009 at 3:02am

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?