Welcome Guest, Not a member yet? Register   Sign In
REST API Design: Filtering, Sorting, and Pagination
#3

Just a suggestion for the lines like this one:
PHP Code:
$this->range = isset($_GET['range']) ? $request->getGet('range') : '1to10'

$request->getGet() will return NULL if the value is not present in the $_GET array, so you can just use the ?? operator like this:

PHP Code:
$this->range $request->getGet('range') ?? '1to10'
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
Reply


Messages In This Thread
RE: REST API Design: Filtering, Sorting, and Pagination - by includebeer - 06-11-2021, 02:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB