Merge pull request #72 from creative-commoners/pulls/2.0/update-documentation

Update section 5 in the sample code to avoid HTML tags being escaped and rendered
This commit is contained in:
Robbie Averill 2018-01-23 14:02:55 +13:00 committed by GitHub
commit d3c579440d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -203,6 +203,7 @@ template, we need to create a SurveyForm method (function) on the controller:
```php
use SilverStripe\CMS\Controllers\ContentController;
use SilverStripe\ORM\FieldType\DBHTMLText;
class PageController extends ContentController
{
@ -220,7 +221,7 @@ class PageController extends ContentController
{
return [
'Title' => 'Thank you for your submission',
'Content' => '<p>You have successfully submitted the form!</p>'
'Content' => DBHTMLText::create('<p>You have successfully submitted the form!</p>')
];
}
}