mirror of https://github.com/vapor/docs.git
Fix custom-tags to make it clear where the implementation is (#671)
This commit is contained in:
parent
4e170d1b7e
commit
f7fa29d260
|
|
@ -22,6 +22,7 @@ Now let's implement the `render(_:)` method. The `LeafContext` context passed to
|
|||
```swift
|
||||
struct NowTagError: Error {}
|
||||
|
||||
func render(_ ctx: LeafContext) throws -> LeafData {
|
||||
let formatter = DateFormatter()
|
||||
switch ctx.parameters.count {
|
||||
case 0: formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
||||
|
|
@ -36,6 +37,7 @@ default:
|
|||
|
||||
let dateAsString = formatter.string(from: Date())
|
||||
return LeafData.string(dateAsString)
|
||||
}
|
||||
```
|
||||
|
||||
!!! tip
|
||||
|
|
|
|||
Loading…
Reference in New Issue