22 lines
429 B
PHP
22 lines
429 B
PHP
<?php
|
|
|
|
namespace Api\Users;
|
|
|
|
use Khofmann\Api\Api;
|
|
use Khofmann\Input\Input;
|
|
use Khofmann\Models\User\User;
|
|
use Khofmann\Response\Response;
|
|
|
|
class Users extends Api
|
|
{
|
|
public function get()
|
|
{
|
|
// Fetch and constrain all parameters.
|
|
$page = max(0, intval(Input::get("p", 0)));
|
|
$limit = constrain(0, 30, intval(Input::get("l", 10)));
|
|
|
|
// Return list of users.
|
|
Response::json(User::list($page, $limit));
|
|
}
|
|
}
|