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.

Archive /

Our old forums are still available as a read-only archive.

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

new Form $controller isn't working


Go to End


1296 Views

Avatar
Flashingback

Community Member, 1 Post

20 October 2008 at 12:32pm

Hello,

I have problems with Form class I have the following code:

class PortfolioMember extends Page_Controller {

	function add(){
		
		
		$fields = new FieldSet(
			new SimpleImageField("project"),
			new TextField("titel","titel"),
			new TextareaField("omschrijving","omschrijving")
		);

		$actions = new FieldSet(new FormAction("save", "save"));
		$form = new Form($this, "add", $fields, $actions);

		
		
		return array(
			"Form" => $form
		);
		
	}

And now the problem: when I view de html it parses this:

<form id="Form_add" action="/?executeForm=add" method="post" enctype="multipart/form-data">

ase you can see the is the action attribute's value "/?executeForm=add". I think it should be
"PortfolioMember/?executeForm=add".

What am I doing Wrong? Or is this a bug?