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

renderWith - I have big problems...


Go to End


1557 Views

Avatar
bezarre

Community Member, 13 Posts

7 August 2010 at 3:07am

Hello,

I am to stupid to use renderWith...

I have the following class:

class builderField extends Form
{

protected $controller;

function __construct($controller) 
{

$this->controller = $controller;

$fields = new FieldSet(
new TextField("builder", "", '')
);

$actions = new FieldSet(
new FormAction('results','Do it'));

return parent::__construct($controller,"Form",$fields,$actions);
}

function results ($data='',$form='')
{
// Some Actions
$da = array ('Test' => 'World');

return $this->controller->customise($da)->renderWith('builder');
}
}

I start the class in my page_controller which works. I get the form returned. But when I send the form up, I get only a empty side with the content of the builder.ss. But the "round-about" of the page.ss is missing.

What is wrong?

I start the class like this:

class Page_Controller extends ContentController
{

function builderForm () {
new builderField($this);
}

}

Please help me....

Bez