Skip to content

Commit e19fba7

Browse files
committed
Merge branch 'main' into craft-5
2 parents fa93e60 + 3a91f6e commit e19fba7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ return [
5151
'criteria' => ['section' => 'news'],
5252
'transformer' => function(Entry $entry) {
5353
return [
54+
'id' => $entry->id,
5455
'title' => $entry->title,
5556
'url' => $entry->url,
56-
'jsonUrl' => UrlHelper::url("news/{$entry->id}.json"),
57+
'jsonUrl' => UrlHelper::url("news/$entry->id.json"),
5758
'summary' => $entry->summary,
5859
];
5960
},
@@ -76,6 +77,7 @@ return [
7677
},
7778
]
7879
];
80+
7981
```
8082

8183
### Endpoint Configuration Settings
@@ -393,7 +395,7 @@ Here are a few endpoint examples, and what their response would look like.
393395
return [
394396
'title' => $entry->title,
395397
'url' => $entry->url,
396-
'jsonUrl' => UrlHelper::url("ingredients/{$entry->slug}.json"),
398+
'jsonUrl' => UrlHelper::url("ingredients/$entry->slug.json"),
397399
];
398400
},
399401
'pretty' => true,

0 commit comments

Comments
 (0)