|
9 | 9 | */ |
10 | 10 | class Welcome extends HungNG_CI_Base_Controllers |
11 | 11 | { |
12 | | - /** |
13 | | - * Welcome constructor. |
14 | | - * |
15 | | - * @author : 713uk13m <dev@nguyenanhung.com> |
16 | | - * @copyright: 713uk13m <dev@nguyenanhung.com> |
17 | | - */ |
18 | | - public function __construct() |
19 | | - { |
20 | | - parent::__construct(); |
21 | | - $this->load->helper('directory'); |
22 | | - } |
| 12 | + /** |
| 13 | + * Welcome constructor. |
| 14 | + * |
| 15 | + * @author : 713uk13m <dev@nguyenanhung.com> |
| 16 | + * @copyright: 713uk13m <dev@nguyenanhung.com> |
| 17 | + */ |
| 18 | + public function __construct() |
| 19 | + { |
| 20 | + parent::__construct(); |
| 21 | + $this->load->helper('directory'); |
| 22 | + } |
23 | 23 |
|
24 | | - /** |
25 | | - * Function index |
26 | | - * |
27 | | - * @author : 713uk13m <dev@nguyenanhung.com> |
28 | | - * @copyright: 713uk13m <dev@nguyenanhung.com> |
29 | | - * @time : 23/06/2022 08:45 |
30 | | - */ |
31 | | - public function index(): void |
32 | | - { |
33 | | - $data = []; |
34 | | - $data['author'] = arrayToObject(config_item('site_author')); |
35 | | - $data['site_data'] = arrayToObject(config_item('site_data')); |
36 | | - $data['tracking'] = arrayToObject(config_item('tracking_code')); |
37 | | - $this->load->view('my_welcome', $data); |
38 | | - } |
| 24 | + /** |
| 25 | + * Function index |
| 26 | + * |
| 27 | + * @author : 713uk13m <dev@nguyenanhung.com> |
| 28 | + * @copyright: 713uk13m <dev@nguyenanhung.com> |
| 29 | + * @time : 23/06/2022 08:45 |
| 30 | + */ |
| 31 | + public function index(): void |
| 32 | + { |
| 33 | + $data = []; |
| 34 | + $data['author'] = arrayToObject(config_item('site_author')); |
| 35 | + $data['site_data'] = arrayToObject(config_item('site_data')); |
| 36 | + $data['tracking'] = arrayToObject(config_item('tracking_code')); |
| 37 | + $this->load->view('my_welcome', $data); |
| 38 | + } |
39 | 39 |
|
40 | | - /** |
41 | | - * Function api |
42 | | - * |
43 | | - * @author : 713uk13m <dev@nguyenanhung.com> |
44 | | - * @copyright: 713uk13m <dev@nguyenanhung.com> |
45 | | - * @time : 23/06/2022 02:03 |
46 | | - */ |
47 | | - public function api(): void |
48 | | - { |
49 | | - $response = [ |
50 | | - 'code' => StatusCodes::HTTP_OK, |
51 | | - 'message' => StatusCodes::$statusTexts[StatusCodes::HTTP_OK], |
52 | | - 'info' => [ |
53 | | - 'name' => 'Hung Nguyen', |
54 | | - 'email' => 'dev@nguyenanhung.com', |
55 | | - 'web' => 'https://nguyenanhung.com', |
56 | | - 'blog' => 'https://blog.nguyenanhung.com', |
57 | | - 'facebook' => 'https://facebook.com/nguyenanhung' |
58 | | - ], |
59 | | - 'data' => [ |
60 | | - 'ip' => getIPAddress(), |
61 | | - 'user_agent' => $this->input->user_agent(true) |
62 | | - ] |
63 | | - ]; |
64 | | - $this->output |
65 | | - ->set_status_header() |
66 | | - ->set_content_type('application/json', 'utf-8') |
67 | | - ->set_output(json_encode($response, JSON_PRETTY_PRINT)) |
68 | | - ->_display(); |
69 | | - exit; |
70 | | - } |
| 40 | + /** |
| 41 | + * Function api |
| 42 | + * |
| 43 | + * @author : 713uk13m <dev@nguyenanhung.com> |
| 44 | + * @copyright: 713uk13m <dev@nguyenanhung.com> |
| 45 | + * @time : 23/06/2022 02:03 |
| 46 | + */ |
| 47 | + public function api(): void |
| 48 | + { |
| 49 | + $response = [ |
| 50 | + 'code' => StatusCodes::HTTP_OK, |
| 51 | + 'message' => StatusCodes::$statusTexts[StatusCodes::HTTP_OK], |
| 52 | + 'data' => [ |
| 53 | + 'author_name' => POWERED_HUNGNG_SHORT_NAME, |
| 54 | + 'author_email' => HUNGNG_EMAIL, |
| 55 | + 'author_web' => HUNGNG_WEBSITE |
| 56 | + ], |
| 57 | + 'support' => [ |
| 58 | + 'issues' => 'https://github.com/nguyenanhung/codeigniter3-skeleton/issues', |
| 59 | + 'wiki' => 'https://github.com/nguyenanhung/codeigniter3-skeleton/wiki', |
| 60 | + 'source' => 'https://github.com/nguyenanhung/codeigniter3-skeleton', |
| 61 | + 'packages' => 'https://packagist.org/packages/nguyenanhung/codeigniter3-skeleton', |
| 62 | + ], |
| 63 | + 'you' => [ |
| 64 | + 'ip' => getIPAddress(), |
| 65 | + 'user_agent' => $this->input->user_agent(true) |
| 66 | + ] |
| 67 | + ]; |
| 68 | + $this->output |
| 69 | + ->set_status_header() |
| 70 | + ->set_content_type('application/json', 'utf-8') |
| 71 | + ->set_output(json_encode($response, JSON_PRETTY_PRINT)) |
| 72 | + ->_display(); |
| 73 | + exit; |
| 74 | + } |
71 | 75 |
|
72 | | - public function command(): void |
73 | | - { |
74 | | - ResponseOutput::writeLn("Welcome CodeIgniter 3 Framework at Time " . date('Y-m-d H:i:s')); |
75 | | - } |
| 76 | + public function command(): void |
| 77 | + { |
| 78 | + ResponseOutput::writeLn("Welcome CodeIgniter 3 Framework at Time " . date('Y-m-d H:i:s')); |
| 79 | + } |
76 | 80 | } |
0 commit comments