From 8e0a815966261689309f9856938bff2d332e13bc Mon Sep 17 00:00:00 2001 From: nguyenanhung Date: Sat, 15 Mar 2025 01:28:49 +0700 Subject: [PATCH] English readme --- README.md | 197 +++++++++++++++++++++++++----------------------------- 1 file changed, 91 insertions(+), 106 deletions(-) diff --git a/README.md b/README.md index 6e8c39c..7c4b7d5 100644 --- a/README.md +++ b/README.md @@ -7,64 +7,43 @@ [![License](https://img.shields.io/packagist/l/nguyenanhung/codeigniter-framework.svg?style=flat-square)](https://packagist.org/packages/nguyenanhung/codeigniter-framework) [![PHP Version Require](https://img.shields.io/packagist/dependency-v/nguyenanhung/codeigniter-framework/php)](https://packagist.org/packages/nguyenanhung/codeigniter-framework) -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 - -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 - -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 -nhật các bản vá lỗi và bổ sung thêm nhiều tính năng mới - -Mục lục -------- - -- [Tính năng](#bổ-sung-thêm-1-số-thư-viện-mở-rộng-helpers-liên-quan) -- [Hướng dẫn cài đặt](#hướng-dẫn-cài-đặt-gói-vào-trong-dự-án) -- [Hướng dẫn sử dụng](#hướng-dẫn-sử-dụng) - - [Hướng dẫn viết Controller kế thừa Base Controller](#hướng-dẫn-viết-controller-kế-thừa-base-controller) - - [Hướng dẫn viết Controller chạy Queue Worker](#hướng-dẫn-viết-controller-chạy-queue-worker) - - [Hướng dẫn viết Controller chạy RESTful API Service](#hướng-dẫn-viết-controller-chạy-restful-api-service) - - [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) - - [Hướng dẫn viết Model kế thừa Base Model](#hướng-dẫn-viết-model-kế-thừa-base-model) - - [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) - - [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) - - [Hướng dẫn sử dụng CSDL MongoDB trong dự án](#hướng-dẫn-sử-dụng-csdl-mongodb-trong-dự-án) - - [Hướng dẫn sử dụng Elasticsearch trong dự án](#hướng-dẫn-sử-dụng-elasticsearch-trong-dự-án) - - [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) - - [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) -- [CodeIgniter Basic Helper](#codeigniter-basic-helper) -- [Liên hệ & Hỗ trợ](#liên-hệ) +Repackaged version of CodeIgniter's system framework, compatible with Composer and PHP 7, PHP 8 +Since version `v3.2.0` - the framework is fully compatible with PHP 8.2 + +This package is constantly updated with new features from the original CodeIgniter3 branch. So it is always +updated with bug fixes and added new features --- -## Các tính năng chính +## Main features -Bổ sung thêm 1 số thư viện mở rộng, helpers liên quan +Added some extension libraries, related helpers -- [x] Base Controllers với nhiều protected method sẵn có -- [x] Support mô hình HMVC +- [x] Base Controllers with many available protected methods +- [x] Support HMVC model - [x] Support RESTful Web Service - [x] Support Queue Worker -- [x] Support CSDL MongoDB +- [x] Support MongoDB database - [x] Support Elasticsearch: Use third party packages `"elasticsearch/elasticsearch": "^8.0 || ^7.0 || ^6.0 || ^5.0"` -- [x] Support class Base Model với 1 số hàm cơ bản đủ dùng với SQL -- [x] Support class ORM Model, cung cấp 1 phương thức đơn giản và dễ dàng hơn để query -- [x] Hỗ trợ Output Response trên giao diện CLI thông qua hàm `ResponseOutput::writeLn($message)` -- [x] Bổ sung class `StatusCodes` khai báo sẵn các HTTP code tuân chuẩn (from Symfony framework), - VD: `StatusCodes::HTTP_OK`. Chi tiết tham khảo thêm tại class `StatusCodes` -- [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 +- [x] Support Base Model class with some basic functions enough for SQL +- [x] Support ORM Model class, providing a simpler and easier method to query +- [x] Support Output Response on CLI interface via function `ResponseOutput::writeLn($message)` +- [x] Added `StatusCodes` class to declare standard HTTP codes (from Symfony framework), + For example: `StatusCodes::HTTP_OK`. For more details, please refer to class `StatusCodes` +- [x] Add many useful helpers with the built-in package `nguyenanhung/codeigniter-basic-helper` via Composer -## Hướng dẫn cài đặt gói vào trong dự án +## Instructions for installing packages into the project -1. Cài đặt gói vào trong dự án với lệnh sau +1. Install the package into the project with the following command ```shell composer require nguyenanhung/codeigniter-framework ``` -2. Cập nhật file `index.php` +2. Update the `index.php` file -Tìm dòng +Find the line ```php /* @@ -78,7 +57,7 @@ Tìm dòng $system_path = 'system'; ``` -Sửa thành như sau +Edit as follows ```php /* @@ -92,16 +71,16 @@ Sửa thành như sau $system_path = '/your_vendor_path/nguyenanhung/codeigniter-framework/system'; ``` -3. Xoá thư mục `system` trong thư mục gốc dự án đi cho gọn +3. Delete the `system` folder in the project root folder for neatness -## Hướng dẫn sử dụng +## User guide -### Hướng dẫn viết Controller kế thừa Base Controller +### Instructions for writing a Controller that inherits a Base Controller -Trong thư viện đã xây dựng sẵn 1 Base Controller, kế thừa như sau +In the library, there is a built-in Base Controller, inherit as follows -1. Xây dựng 1 `Controller` mới theo tài liệu CodeIgniter 3 -2. Kế thừa class từ `HungNG_CI_Base_Controllers` thay vì `CI_Controller`, ví dụ như sau +1. Build a new `Controller` according to the CodeIgniter 3 documentation +2. Inherit the class from `HungNG_CI_Base_Controllers` instead of `CI_Controller`, for example as follows ```php