Merge pull request #3160 from sanjaymundhra/patch-8

Update simple-contact-form.md
This commit is contained in:
Damian Mooyman 2014-05-27 11:40:02 +12:00
commit 1c9f9551b6

View File

@ -46,7 +46,8 @@ We then create a `[api:FieldList]` of the form actions, or the buttons that subm
:::php
return new Form($this, 'Form', $fields, $actions);
Finally we create the `Form` object and return it. The first argument is the name of the form this has to be the same as the name of the function that creates the form, so we've used 'Form'. The second argument is the controller that the form is on this is almost always $this. The third and fourth arguments are the fields and actions we created earlier.
Finally we create the `Form` object and return it. The first argument is the controller that the form is on this is almost always $this. The second argument is the name of the form this has to be the same as the name of the function that creates the form, so we've used 'Form'. The third and fourth arguments are the fields and actions we created earlier.
To show the form on the page, we need to render it in our template. We do this by appending $ to the name of the form so for the form we just created we need to add $Form. Add $Form to the themes/currenttheme/Layout/Page.ss template, below $Content.