Update 09_Casting.md

This commit is contained in:
Manuel Thalmann 2021-05-17 01:34:01 +02:00 committed by GitHub
parent 1c1298e062
commit 3a49759c0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,7 +17,7 @@ output the result of the [DBHtmlText::FirstParagraph()](api:SilverStripe\ORM\Fie
```ss ```ss
$Content.FirstParagraph $Content.FirstParagraph
<!-- returns the result of HtmlText::FirstParagragh() --> <!-- returns the result of DBHtmlText::FirstParagragh() -->
$LastEdited.Format("d/m/Y") $LastEdited.Format("d/m/Y")
<!-- returns the result of DBDatetime::Format("d/m/Y") --> <!-- returns the result of DBDatetime::Format("d/m/Y") -->
@ -72,7 +72,7 @@ $Me
## Casting ## Casting
Methods which return data to the template should either return an explicit object instance describing the type of Methods which return data to the template should either return an explicit object instance describing the type of
content that method sends back, or, provide a type in the `$casting` array for the object. When rendering that method content that method sends back, or provide a type in the `$casting` array for the object. When rendering that method
to a template, SilverStripe will ensure that the object is wrapped in the correct type and values are safely escaped. to a template, SilverStripe will ensure that the object is wrapped in the correct type and values are safely escaped.
```php ```php