From d3f42ca487287447efb81061609644108044a038 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sat, 19 May 2018 15:04:04 +0200 Subject: Implements Tags endpoints for Shaarli's REST API Endpoints: * List All Tags [GET] * Get a tag [GET] * Update a tag [PUT] * Delete a tag [DELETE] Fixes #904 References shaarli/api-documentation#34 --- application/api/controllers/Links.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'application/api/controllers/Links.php') diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php index 3a9c0355..ffcfd4c7 100644 --- a/application/api/controllers/Links.php +++ b/application/api/controllers/Links.php @@ -68,16 +68,16 @@ class Links extends ApiController } // 'environment' is set by Slim and encapsulate $_SERVER. - $index = index_url($this->ci['environment']); + $indexUrl = index_url($this->ci['environment']); $out = []; - $cpt = 0; + $index = 0; foreach ($links as $link) { if (count($out) >= $limit) { break; } - if ($cpt++ >= $offset) { - $out[] = ApiUtils::formatLink($link, $index); + if ($index++ >= $offset) { + $out[] = ApiUtils::formatLink($link, $indexUrl); } } -- cgit v1.2.3