Skip to content

Commit df382cb

Browse files
committed
Index values match id values so as not to cause confusion
1 parent 43cb19a commit df382cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

application/controllers/api/Example.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public function users_get($id = NULL)
3535
// Users from a data store e.g. database
3636
// $user = $this->some_model->getSomething($id);
3737
$users = [
38-
['id' => 1, 'name' => 'John', 'email' => '[email protected]', 'fact' => 'Loves coding'],
39-
['id' => 2, 'name' => 'Jim', 'email' => '[email protected]', 'fact' => 'Developed on CodeIgniter'],
40-
['id' => 3, 'name' => 'Jane', 'email' => '[email protected]', 'fact' => 'Lives in the USA', ['hobbies' => ['guitar', 'cycling']]],
38+
1 => ['id' => 1, 'name' => 'John', 'email' => '[email protected]', 'fact' => 'Loves coding'],
39+
2 => ['id' => 2, 'name' => 'Jim', 'email' => '[email protected]', 'fact' => 'Developed on CodeIgniter'],
40+
3 => ['id' => 3, 'name' => 'Jane', 'email' => '[email protected]', 'fact' => 'Lives in the USA', ['hobbies' => ['guitar', 'cycling']]],
4141
];
4242

4343
// If the id parameter and query parameter don't exist, return all users instead

0 commit comments

Comments
 (0)