-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3869e9
commit 076d3a4
Showing
2 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,36 @@ public function __construct() | |
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Function defaultJsonResponseInfo | ||
* | ||
* @author : 713uk13m <[email protected]> | ||
* @copyright: 713uk13m <[email protected]> | ||
* @time : 25/06/2022 20:41 | ||
*/ | ||
protected function defaultJsonResponseInfo() | ||
{ | ||
$response = [ | ||
'code' => StatusCodes::HTTP_OK, | ||
'message' => StatusCodes::$statusTexts[StatusCodes::HTTP_OK], | ||
'info' => [ | ||
'name' => 'Nguyen An Hung', | ||
'email' => '[email protected]', | ||
'web' => 'https://nguyenanhung.com', | ||
'blog' => 'https://blog.nguyenanhung.com', | ||
'facebook' => 'https://facebook.com/nguyenanhung', | ||
'github' => 'https://github.com/nguyenanhung', | ||
], | ||
'request_data' => [ | ||
'ip' => getIPAddress(), | ||
'user_agent' => $this->input->user_agent(true), | ||
'request_method' => $this->input->method(true) | ||
] | ||
]; | ||
$this->output->set_status_header()->set_content_type('application/json', 'utf-8')->set_output(json_encode($response, JSON_PRETTY_PRINT))->_display(); | ||
exit; | ||
} | ||
|
||
/** | ||
* Function renderOutput | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,6 +72,36 @@ public function __construct() | |
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Function defaultJsonResponseInfo | ||
* | ||
* @author : 713uk13m <[email protected]> | ||
* @copyright: 713uk13m <[email protected]> | ||
* @time : 25/06/2022 20:41 | ||
*/ | ||
protected function defaultJsonResponseInfo() | ||
{ | ||
$response = [ | ||
'code' => StatusCodes::HTTP_OK, | ||
'message' => StatusCodes::$statusTexts[StatusCodes::HTTP_OK], | ||
'info' => [ | ||
'name' => 'Nguyen An Hung', | ||
'email' => '[email protected]', | ||
'web' => 'https://nguyenanhung.com', | ||
'blog' => 'https://blog.nguyenanhung.com', | ||
'facebook' => 'https://facebook.com/nguyenanhung', | ||
'github' => 'https://github.com/nguyenanhung', | ||
], | ||
'request_data' => [ | ||
'ip' => getIPAddress(), | ||
'user_agent' => $this->input->user_agent(true), | ||
'request_method' => $this->input->method(true) | ||
] | ||
]; | ||
$this->output->set_status_header()->set_content_type('application/json', 'utf-8')->set_output(json_encode($response, JSON_PRETTY_PRINT))->_display(); | ||
exit; | ||
} | ||
|
||
/** | ||
* Function renderOutput | ||
* | ||
|