77[ ![ License] ( https://img.shields.io/packagist/l/nguyenanhung/codeigniter-framework.svg?style=flat-square )] ( https://packagist.org/packages/nguyenanhung/codeigniter-framework )
88[ ![ PHP Version Require] ( https://img.shields.io/packagist/dependency-v/nguyenanhung/codeigniter-framework/php )] ( https://packagist.org/packages/nguyenanhung/codeigniter-framework )
99
10- Bản đóng gói lại thư mục system framework của CodeIgniter, sử dụng tương thích với Composer và PHP 7, PHP 8
11-
12- Kể từ phiên bản ` v3.2.0 ` - framework hoàn toàn tương thích với phiên bản PHP 8.2
13-
14- Bản đóng gói này được liên tục cập nhật với các feature mới từ nhánh CodeIgniter3 nguyên bản. Vì vậy nó luôn được cập
15- nhật các bản vá lỗi và bổ sung thêm nhiều tính năng mới
16-
17- Mục lục
18- -------
19-
20- - [ Tính năng] ( #bổ-sung-thêm-1-số-thư-viện-mở-rộng-helpers-liên-quan )
21- - [ Hướng dẫn cài đặt] ( #hướng-dẫn-cài-đặt-gói-vào-trong-dự-án )
22- - [ Hướng dẫn sử dụng] ( #hướng-dẫn-sử-dụng )
23- - [ Hướng dẫn viết Controller kế thừa Base Controller] ( #hướng-dẫn-viết-controller-kế-thừa-base-controller )
24- - [ Hướng dẫn viết Controller chạy Queue Worker] ( #hướng-dẫn-viết-controller-chạy-queue-worker )
25- - [ Hướng dẫn viết Controller chạy RESTful API Service] ( #hướng-dẫn-viết-controller-chạy-restful-api-service )
26- - [ Hướng dẫn tích hợp mô hình HMVC (Modular) vào dự án] ( #hướng-dẫn-tích-hợp-mô-hình-hmvc-vào-dự-án )
27- - [ Hướng dẫn viết Model kế thừa Base Model] ( #hướng-dẫn-viết-model-kế-thừa-base-model )
28- - [ Hướng dẫn viết Model kế thừa Base ORM Model] ( #hướng-dẫn-viết-model-kế-thừa-base-orm-model )
29- - [ Hướng dẫn viết tích hợp SEO cơ bản] ( #hướng-dẫn-tích-hợp-seo-cơ-bản )
30- - [ Hướng dẫn sử dụng CSDL MongoDB trong dự án] ( #hướng-dẫn-sử-dụng-csdl-mongodb-trong-dự-án )
31- - [ Hướng dẫn sử dụng Elasticsearch trong dự án] ( #hướng-dẫn-sử-dụng-elasticsearch-trong-dự-án )
32- - [ Hướng dẫn sử dụng kiểm tra các filename trong dự án của bạn đã đúng chuẩn của CodeIgniter hay chưa] ( #hướng-dẫn-sử-dụng-kiểm-tra-các-filename-trong-dự-án-của-bạn-đã-đúng-chuẩn-của-codeigniter-hay-chưa )
33- - [ Hướng dẫn sử dụng ghi log tất cả các queries trong CodeIgniter và ghi lại Execution Time của từng Queries] ( #hướng-dẫn-sử-dụng-ghi-log-tất-cả-các-queries-trong-codeigniter-và-ghi-lại-execution-time-của-từng-queries )
34- - [ CodeIgniter Basic Helper] ( #codeigniter-basic-helper )
35- - [ Liên hệ & Hỗ trợ] ( #liên-hệ )
10+ Repackaged version of CodeIgniter's system framework, compatible with Composer and PHP 7, PHP 8
3611
12+ Since version ` v3.2.0 ` - the framework is fully compatible with PHP 8.2
13+
14+ This package is constantly updated with new features from the original CodeIgniter3 branch. So it is always
15+ updated with bug fixes and added new features
3716---
3817
39- ## Các tính năng chính
18+ ## Main features
4019
41- Bổ sung thêm 1 số thư viện mở rộng, helpers liên quan
20+ Added some extension libraries, related helpers
4221
43- - [x] Base Controllers với nhiều protected method sẵn có
44- - [x] Support mô hình HMVC
22+ - [x] Base Controllers with many available protected methods
23+ - [x] Support HMVC model
4524- [x] Support RESTful Web Service
4625- [x] Support Queue Worker
47- - [x] Support CSDL MongoDB
26+ - [x] Support MongoDB database
4827- [x] Support Elasticsearch: Use third party packages ` "elasticsearch/elasticsearch": "^8.0 || ^7.0 || ^6.0 || ^5.0" `
49- - [x] Support class Base Model với 1 số hàm cơ bản đủ dùng với SQL
50- - [x] Support class ORM Model, cung cấp 1 phương thức đơn giản và dễ dàng hơn để query
51- - [x] Hỗ trợ Output Response trên giao diện CLI thông qua hàm ` ResponseOutput::writeLn($message) `
52- - [x] Bổ sung class ` StatusCodes ` khai báo sẵn các HTTP code tuân chuẩn (from Symfony framework),
53- VD : ` StatusCodes::HTTP_OK ` . Chi tiết tham khảo thêm tại class ` StatusCodes `
54- - [x] Bổ sung rất nhiều helper tiện dụng với việc tích hợp sẵn gói ` nguyenanhung/codeigniter-basic-helper ` thông qua
28+ - [x] Support Base Model class with some basic functions enough for SQL
29+ - [x] Support ORM Model class, providing a simpler and easier method to query
30+ - [x] Support Output Response on CLI interface via function ` ResponseOutput::writeLn($message) `
31+ - [x] Added ` StatusCodes ` class to declare standard HTTP codes (from Symfony framework),
32+ For example : ` StatusCodes::HTTP_OK ` . For more details, please refer to class ` StatusCodes `
33+ - [x] Add many useful helpers with the built-in package ` nguyenanhung/codeigniter-basic-helper ` via
5534 Composer
5635
57- ## Hướng dẫn cài đặt gói vào trong dự án
36+ ## Instructions for installing packages into the project
5837
59- 1 . Cài đặt gói vào trong dự án với lệnh sau
38+ 1 . Install the package into the project with the following command
6039
6140``` shell
6241composer require nguyenanhung/codeigniter-framework
6342```
6443
65- 2 . Cập nhật file ` index.php `
44+ 2 . Update the ` index.php ` file
6645
67- Tìm dòng
46+ Find the line
6847
6948``` php
7049/*
@@ -78,7 +57,7 @@ Tìm dòng
7857 $system_path = 'system';
7958```
8059
81- Sửa thành như sau
60+ Edit as follows
8261
8362``` php
8463/*
@@ -92,16 +71,16 @@ Sửa thành như sau
9271 $system_path = '/your_vendor_path/nguyenanhung/codeigniter-framework/system';
9372```
9473
95- 3 . Xoá thư mục ` system ` trong thư mục gốc dự án đi cho gọn
74+ 3 . Delete the ` system ` folder in the project root folder for neatness
9675
97- ## Hướng dẫn sử dụng
76+ ## User guide
9877
99- ### Hướng dẫn viết Controller kế thừa Base Controller
78+ ### Instructions for writing a Controller that inherits a Base Controller
10079
101- Trong thư viện đã xây dựng sẵn 1 Base Controller, kế thừa như sau
80+ In the library, there is a built-in Base Controller, inherit as follows
10281
103- 1 . Xây dựng 1 ` Controller ` mới theo tài liệu CodeIgniter 3
104- 2 . Kế thừa class từ ` HungNG_CI_Base_Controllers ` thay vì ` CI_Controller ` , ví dụ như sau
82+ 1 . Build a new ` Controller ` according to the CodeIgniter 3 documentation
83+ 2 . Inherit the class from ` HungNG_CI_Base_Controllers ` instead of ` CI_Controller ` , for example as follows
10584
10685``` php
10786<?php
@@ -127,12 +106,12 @@ class Hungna_test extends HungNG_CI_Base_Controllers
127106
128107```
129108
130- ### Hướng dẫn viết Controller chạy Queue Worker
109+ ### Instructions for writing a Controller that runs a Queue Worker
131110
132- Trong thư viện đã xây dựng sẵn 1 Base Queue Worker (được xây dựng bởi yidas), kế thừa như sau
111+ In the library, there is a built-in Base Queue Worker (built by yidas), inherit as follows
133112
134- 1 . Xây dựng 1 ` Controller ` mới theo tài liệu CodeIgniter 3
135- 2 . Kế thừa class từ ` HungNG_CI_Base_Queue_Worker ` thay vì ` CI_Controller ` , ví dụ như sau
113+ 1 . Build a new ` Controller ` according to the CodeIgniter 3 documentation
114+ 2 . Inherit the class from ` HungNG_CI_Base_Queue_Worker ` instead of ` CI_Controller ` , for example as follows
136115
137116``` php
138117<?php
@@ -156,15 +135,15 @@ class My_worker extends HungNG_CI_Base_Queue_Worker
156135
157136```
158137
159- Tìm hiểu thêm chi tiết tài liệu tại
160- đây : [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-queue-worker ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-queue-worker )
138+ Learn more details in the documentation
139+ here : [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-queue-worker ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-queue-worker )
161140
162- ### Hướng dẫn viết Controller chạy RESTful API Service
141+ ### Instructions for writing a Controller to run RESTful API Service
163142
164- Trong thư viện đã xây dựng sẵn 1 Base RESTful (được xây dựng bởi yidas), kế thừa như sau
143+ In the library, there is a pre-built RESTful Base (built by yidas), inherit as follows
165144
166- 1 . Xây dựng 1 ` Controller ` mới theo tài liệu CodeIgniter 3
167- 2 . Kế thừa class từ ` HungNG_CI_Base_REST ` thay vì ` CI_Controller ` , ví dụ như sau
145+ 1 . Build a new ` Controller ` according to the CodeIgniter 3 documentation
146+ 2 . Inherit the class from ` HungNG_CI_Base_REST ` instead of ` CI_Controller ` , for example as follows
168147
169148``` php
170149<?php
@@ -192,13 +171,13 @@ class My_rest_api extends HungNG_CI_Base_REST
192171
193172```
194173
195- Tìm hiểu thêm chi tiết tài liệu tại
196- đây : [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-rest ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-rest )
174+ Learn more details in the documentation
175+ here : [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-rest ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-rest )
197176
198- ### Hướng dẫn viết Model kế thừa Base Model
177+ ### Instructions for writing a Model that inherits Base Model
199178
200- 1 . Xây dựng 1 model theo tài liệu CodeIgniter 3
201- 2 . Kế thừa class từ ` HungNG_Custom_Based_model ` thay vì ` CI_Model ` , ví dụ như sau
179+ 1 . Build a model according to the CodeIgniter 3 documentation
180+ 2 . Inherit the class from ` HungNG_Custom_Based_model ` instead of ` CI_Model ` , for example as follows
202181
203182``` php
204183<?php
@@ -241,39 +220,41 @@ class Credentials_model extends HungNG_Custom_Based_model
241220}
242221```
243222
244- ### Hướng dẫn viết Model kế thừa Base ORM Model
223+ ### How to write a Model that inherits the Base ORM Model
224+
225+ 1 . This package adds a modern way to write models in ORM style with Elegant patterns like Laravel Eloquent ORM & Yii2
226+ Active Record (built by yidas)
227+ 2 . Read detailed documentation on how to integrate and deploy here with visual and specific
228+ examples: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-orm-model ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-orm-model )
245229
246- 1 . Package này bổ sung thêm 1 phương án viết model hiện đại theo phong cách ORM với Elegant patterns giống như Laravel
247- Eloquent ORM & Yii2 Active Record (được xây dựng bởi yidas)
248- 2 . Đọc tài liệu chi tiết về cách tích hợp và triển khai tại đây với những ví dụ trực quan và cụ
249- thể: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-orm-model ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-orm-model )
230+ ### Basic SEO Integration Guide
250231
251- ### Hướng dẫn tích hợp SEO cơ bản
232+ 1 . This package adds a simple SEO library and helper
252233
253- 1 . Package này bổ sung thêm 1 thư viện và helper SEO đơn giản
254- 2 . Đọc tài liệu chi tiết về cách tích hợp và triển khai tại đây với những ví dụ trực quan và cụ
255- thể: [ https://github.com/nguyenanhung/codeigniter-framework-sample/blob/main/codeigniter3-basic-seo/README.md ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/blob/main/codeigniter3-basic-seo/README.md )
234+ 2 . Read detailed documentation on how to integrate and deploy here with visual and specific
235+ examples: [ https://github.com/nguyenanhung/codeigniter-framework-sample/blob/main/codeigniter3-basic-seo/README.md ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/blob/main/codeigniter3-basic-seo/README.md )
256236
257- ### Hướng dẫn sử dụng CSDL MongoDB trong dự án
237+ ### Instructions for using MongoDB database in the project
258238
259- 1 . Mặc định , CodeIgniter v3 không hỗ trợ MongoDB. Tuy nhiên không vì thế mà hạn chế , CodeIgniter là framework mở, vì vậy
260- tôi đã bổ sung thêm 1 thư viện hỗ trợ việc gọi, tương tác, xử lý với CSDL MongoDB mà cách sử dụng cũng tương đối
261- giống với Query
262- Builder của CodeIgniter
263- 2 . Đọc tài liệu chi tiết về cách tích hợp và triển khai tại đây với những ví dụ trực quan và cụ
264- thể : [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-mongodb ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-mongodb )
239+ 1 . By default , CodeIgniter v3 does not support MongoDB. However, that is not a limitation , CodeIgniter is an open
240+ framework, so
241+ I have added a library to support calling, interacting, and processing with MongoDB database, which is also quite
242+ similar to CodeIgniter 2's Query
243+ Builder. Read detailed documentation on how to integrate and deploy here with intuitive and specific
244+ examples : [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-mongodb ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-mongodb )
265245
266- ### Hướng dẫn sử dụng Elasticsearch trong dự án
246+ ### Instructions for using Elasticsearch in the project
267247
268- 1 . Mặc định, CodeIgniter v3 không hỗ trợ Elasticsearch. Tuy nhiên không vì thế mà hạn chế, CodeIgniter là framework mở,
269- vì vậy tôi đã bổ sung thêm 1 thư viện hỗ trợ việc gọi, tác với Elasticsearch
270- 2 . Đọc tài liệu chi tiết về cách tích hợp và triển khai tại đây với những ví dụ trực quan và cụ
271- thể: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-elasticsearch ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-elasticsearch )
248+ 1 . By default, CodeIgniter v3 does not support Elasticsearch. However, that does not limit it, CodeIgniter is an open
249+ framework,
250+ so I have added a library to support calling and interacting with Elasticsearch
251+ 2 . Read detailed documentation on how to integrate and deploy here with intuitive and specific
252+ examples: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-elasticsearch ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-elasticsearch )
272253
273- ### Hướng dẫn tích hợp mô hình HMVC vào dự án
254+ ### Instructions for integrating HMVC model into the project
274255
275- 1 . Create folder: ` modules ` trong thư mục ` application ` . Tham khảo cấu trúc thư mục ` modules-samples `
276- tại https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/modules-sample
256+ 1 . Create folder: ` modules ` in the ` application ` folder. Refer to the ` modules-samples ` folder structure
257+ at https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/modules-sample
277258
278259``` shell
279260.
@@ -295,7 +276,7 @@ class Credentials_model extends HungNG_Custom_Based_model
2952766 directories, 8 files
296277```
297278
298- 2 . Create file ` hmvc.php ` với nội dung như sau
279+ 2 . Create file ` hmvc.php ` with the following content
299280
300281``` php
301282<?php
@@ -313,13 +294,13 @@ $config['modules_locations'] = array(
313294
314295```
315296
316- 3 . Nạp file ` hmvc.php ` vào file ` config.php `
297+ 3 . Load the ` hmvc.php ` file into the ` config.php ` file
317298
318299``` php
319300require_once __DIR__ . '/hmvc.php';
320301```
321302
322- 4 . Create file ` MY_Loader.php ` trong thư mục ` application/core/ ` có nội dung như sau
303+ 4 . Create file ` MY_Loader.php ` in folder ` application/core/ ` with following content
323304
324305``` php
325306<?php
@@ -336,7 +317,7 @@ class MY_Loader extends HungNG_Loader
336317}
337318```
338319
339- 5 . Create file ` MY_Router.php ` trong thư mục ` application/core/ ` có nội dung như sau
320+ 5 . Create file ` MY_Router.php ` in folder ` application/core/ ` with following content
340321
341322``` php
342323<?php
@@ -354,7 +335,7 @@ class MY_Router extends HungNG_Router
354335
355336```
356337
357- 6 . Triển khai viết code trong thư mục modules mới, tương tự như sau
338+ 6 . Deploy the code in the new modules folder, similar to the following
358339
359340``` php
360341<?php
@@ -381,27 +362,31 @@ class TestModule extends HungNG_CI_Base_Module
381362
382363```
383364
384- ### Hướng dẫn sử dụng kiểm tra các filename trong dự án của bạn đã đúng chuẩn của CodeIgniter hay chưa
365+ ### How to check if the filenames in your project are up to CodeIgniter standards
385366
3863671 . This controller checks CodeIgniter 3.0 class filename.
387- 2 . Đọc tài liệu chi tiết về cách tích hợp và triển khai tại đây với những ví dụ trực quan và cụ
388- thể: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter3-filename-checker ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter3-filename-checker )
389368
390- ### Hướng dẫn sử dụng ghi log tất cả các queries trong CodeIgniter và ghi lại Execution Time của từng Queries
369+ 2 . Read detailed documentation on how to integrate and deploy here with visual and specific
370+ examples: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter3-filename-checker ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter3-filename-checker )
371+
372+ ### Instructions for logging all queries in CodeIgniter and recording the Execution Time of each Queries
373+
374+ 1 . By default, CodeIgniter v3 does not support logging the Execution Time of Queries. However, you can use Hooks to do
375+ this
391376
392- 1 . Mặc định, CodeIgniter v3 không hỗ trợ ghi log Execution Time của các Queries. Tuy nhiên, có thể sử dụng Hooks để thực
393- hiện điều này
394- 2 . Đọc tài liệu chi tiết về cách tích hợp và triển khai tại đây với những ví dụ trực quan và cụ
395- thể: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-log-all-queries ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-log-all-queries )
377+ 2 . Read the detailed documentation on how to integrate and deploy here with visual and specific
378+ examples: [ https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-log-all-queries ] ( https://github.com/nguyenanhung/codeigniter-framework-sample/tree/main/codeigniter-log-all-queries )
396379
397380## CodeIgniter Basic Helper
398381
399- - Trong nhiều năm làm lập trình với CodeIgniter, tôi đã sưu tập, xây dựng và viết được kha khá helper, tôi đã đóng gói
400- chúng lại thành gói ` nguyenanhung/codeigniter-basic-helper ` và tích hợp vào bên trong gói này.
401- - Gói helper này vẫn đang được tôi vận hành và phát triển hàng ngày, số project tích hợp các hàm trong gói này đã lên
402- con số hàng nghìn
403- - Thông tin chi tiết hơn về bộ helper
404- này [ https://github.com/nguyenanhung/codeigniter-basic-helper ] ( https://github.com/nguyenanhung/codeigniter-basic-helper )
382+ - Over the years of programming with CodeIgniter, I have collected, built and written quite a few helpers, I have
383+ packaged
384+ them into the package ` nguyenanhung/codeigniter-basic-helper ` and integrated them into this package.
385+ - This helper package is still being operated and developed by me every day, the number of projects integrating the
386+ functions in this package has reached
387+ thousands
388+ - More detailed information about this helper
389+ set [ https://github.com/nguyenanhung/codeigniter-basic-helper ] ( https://github.com/nguyenanhung/codeigniter-basic-helper )
405390
406391## Liên hệ
407392
0 commit comments