getUserFeed($user); if ($user_feed) { $max = count($user_feed->items) > $max_items_per_user ? $max_items_per_user : count($user_feed->items); for ($i = 0; $i < $max; $i++) { $item = $user_feed->items[$i]; array_push($items, $item); } } } } $feed = (object) [ 'items' => $items, 'hasMore' => false ]; $latte = Misc::latte(); $latte->render(Misc::getView('following'), new FollowingTemplate($following, $feed)); });