From f114c65355d722edeb94994bf145d1f79a355730 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 12 Oct 2014 11:30:26 +0200 Subject: [PATCH] Added default tag order to post view proxy --- src/Controllers/ViewProxies/PostViewProxy.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Controllers/ViewProxies/PostViewProxy.php b/src/Controllers/ViewProxies/PostViewProxy.php index 96ab15f7..595c83e9 100644 --- a/src/Controllers/ViewProxies/PostViewProxy.php +++ b/src/Controllers/ViewProxies/PostViewProxy.php @@ -77,7 +77,13 @@ class PostViewProxy extends AbstractViewProxy $result->flags->loop = ($post->getFlags() & Post::FLAG_LOOP); if (!empty($config[self::FETCH_TAGS])) + { $result->tags = $this->tagViewProxy->fromArray($post->getTags()); + usort($result->tags, function($tag1, $tag2) + { + return strcasecmp($tag1->name, $tag2->name); + }); + } if (!empty($config[self::FETCH_USER])) $result->user = $this->userViewProxy->fromEntity($post->getUser());