From 2da8f28bbbaf37ec78e889feef2a497bc67f4da2 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Tue, 4 Feb 2014 10:17:02 +1300 Subject: [PATCH] Updating broken links and other misc bits of documentation --- README.md | 50 +++++++++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 5fa6b55..df9666d 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ individual implementation can be customized to the project requirements. ## Requirements -SilverStripe 2.4 or higher is required. +SilverStripe 3.1+. ## What it does do @@ -70,17 +70,15 @@ before. If you are not familiar with SilverStripe, it is highly recommended you run through the tutorials before attempting to start with this one. -* [View a listing of all available tutorials](/tutorials) +* [View a listing of all available tutorials](http://doc.silverstripe.org/tutorials) ### 1. Installing -[Download a version of multiform](multiform#downloading). Install it as a -sibling of the top level directories (framework and cms) in your installation. +Using [Composer](https://getcomposer.org/), you can install multiform into your +SilverStripe site using this command (while in the directory where your site is +currently located) -If you use composer to manage your SilverStripe installation add the following -line to your composer.json file - - "silverstripe/multiform": "dev-master" + composer require "silverstripe/multiform:*" ### 2. Create subclass of MultiForm @@ -93,8 +91,8 @@ site called "Bob's Chicken Shack" then a good name would be *BCSMultiForm*. This makes sense, as it is specific to the project that you're developing a multi-form for. -Keep in mind the PHP file you create must be in the mysite/code directory, and -the filename must be the same as the class name, with the .php extension. +Keep in mind the PHP file you create must be in the `mysite/code` directory, and +the filename must be the same as the class name, with the `.php` extension. For the above example, our multi-form will be called *BCSMultiForm.php* @@ -168,7 +166,7 @@ the `$start_step` variable *BCSMultiForm*, but we call it `$next_steps`. } -At the very least, each step also has to have a ''getFields()'' method returning +At the very least, each step also has to have a `getFields()` method returning a *FieldSet* with some form field objects. These are the fields that the form will render for the given step. @@ -202,7 +200,7 @@ However, we've forgotten one thing. We need to create a method on a page-type so that the form can be rendered into a given template. So, if we want to render our multi-form as `$BCSMultiForm` in the *Page.ss* -template, we need to create a BCSMultiForm method (function) on Page_Controller: +template, we need to create a BCSMultiForm method (function) on the controller: :::php saveInto()'' with MultiForm, as it doesn't have all steps in the $form context at ''finish()'' +* Code example on how to use `$form->saveInto()` with MultiForm, as it doesn't have all steps in the $form context at `finish()` * Allowing a user to click a link, and have an email sent to them with the current state, so they can come back and use the form exactly where they left off @@ -602,18 +599,17 @@ more information, see [:scheduledtask](/scheduledtask) for more information. * Different presentation of the URL to identify each step. -* Allow customisation of ''prev()'' and ''next()'' on each step. Currently you can only customise for the entire MultiForm subclass. There is a way to customise on a per step basis, which could be described in a small recipe. +* Allow customisation of `prev()` and `next()` on each step. Currently you can only customise for the entire MultiForm subclass. There is a way to customise on a per step basis, which could be described in a small recipe. -* More detailed explanation, and recipe example on how to make branched multistep forms. For example, clicking a different action takes you to an alternative next step than the one defined in ''$next_steps'' +* More detailed explanation, and recipe example on how to make branched multistep forms. For example, clicking a different action takes you to an alternative next step than the one defined in `$next_steps` ## Related * [Form](/form) - * [Form field types](/form-field-types) - * [Form recipes](recipes/forms) + * [Form field types](http://doc.silverstripe.org/form-field-types) * [Tutorials](/tutorials) - * [Tutorial 3 - Forms](tutorial/3-forms) + * [Tutorial 3 - Forms](http://doc.silverstripe.org/framework/en/tutorials/3-forms) -* [Templates](/templates) \ No newline at end of file +* [Templates](http://doc.silverstripe.org/framework/en/reference/templates)