Skip to content

Commit c82d05e

Browse files
committed
Example.php: Some comment modifications.
1 parent 83f0c1c commit c82d05e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

application/controllers/api/Example.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ function __construct()
3333
public function users_get()
3434
{
3535
// Users from a data store e.g. database
36-
// $user = $this->some_model->getSomething($id);
3736
$users = [
3837
['id' => 1, 'name' => 'John', 'email' => '[email protected]', 'fact' => 'Loves coding'],
3938
['id' => 2, 'name' => 'Jim', 'email' => '[email protected]', 'fact' => 'Developed on CodeIgniter'],
@@ -42,7 +41,8 @@ public function users_get()
4241

4342
$id = $this->get('id');
4443

45-
// If the id parameter and query parameter don't exist, return all users instead
44+
// If the id parameter doesn't exist return all the users
45+
4646
if ($id === NULL)
4747
{
4848
// Check if the users data store contains users (in case the database result returns NULL)
@@ -61,6 +61,8 @@ public function users_get()
6161
}
6262
}
6363

64+
// Find and return a single record for a particular user.
65+
6466
$id = (int) $id;
6567

6668
// Validate the id.

0 commit comments

Comments
 (0)