Skip to content

Commit

Permalink
Merge pull request #61 from sunnysideup/patch-1
Browse files Browse the repository at this point in the history
MINOR: better getter in example
  • Loading branch information
bummzack authored May 25, 2022
2 parents 0028923 + 07fdb2e commit 6777f3c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ Sorting the Files via a relation table isn't easily achievable via a DataExtensi

```php
// Use this in your templates to get the correctly sorted images

public function Images()
{
return $this->getManyManyComponents('Images')->sort('SortOrder');
}

// and/or
public function SortedImages()
{
return $this->Images()->Sort('SortOrder');
Expand Down

0 comments on commit 6777f3c

Please sign in to comment.