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.

General Questions /

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

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

DataObjectDecorator on NewsLetter


Go to End
Reply


720 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?