DOCS Update sample code to avoid HTML tags being escaped and rendered

This commit is contained in:
Raissa North 2018-01-23 10:51:40 +13:00
parent 231f195174
commit b85c9bb383

View File

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