/codeigniter-basic-helper

CodeIgniter - Basic Helper

Primary LanguagePHPGNU General Public License v3.0GPL-3.0

CodeIgniter Basic Helper

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

Summary

1 vài helper cơ bản khi sử dụng với CodeIgniter 3.

Có thể đưa vào nhiều bộ code khác, tuy nhiên có 1 số function require framework CodeIgniter, tuy nhiên không ảnh hưởng tới hiệu suất sử dụng

1 số helper được hỗ trợ sẵn

Dưới đây là danh sách các Helper được hỗ trợ trong bộ thư viện này

AlphaID Helper

  • Helper Function: generateAlphaId - Hàm giúp tạo 1 Id unique 4ew68i32xc dựa trên 1 int đầu vào như 1234

Array Helper

  • Helper Function: arrayToObject - Hàm giúp chuyển 1 array thành 1 object
  • Helper Function: arrayToXml - Hàm giúp chuyển array thành 1 chuỗi XML

Assets Helper

  • Helper Function: assets_url - Hàm lấy ra Assets Url, điều kiện tồn tại thư mục assets trong thư mục public/. Trong trường hợp trong file config.php tồn tại biến assets_version sẽ tự động thêm version vào đằng sau các file CSS, JS
  • Helper Function: templates_url - Hàm lấy ra Assets Url, điều kiện tồn tại thư mục templates trong thư mục public/. Trong trường hợp trong file config.php tồn tại biến assets_version sẽ tự động thêm version vào đằng sau các file CSS, JS
  • Helper Function: editor_url - Hàm lấy ra Assets Url, điều kiện tồn tại thư mục assets/editors/ trong thư mục public/. Trong trường hợp trong file config.php tồn tại biến assets_version sẽ tự động thêm version vào đằng sau các file CSS, JS
  • Helper Function: favicon_url- Hàm lấy ra Assets Url, điều kiện tồn tại thư mục assets/favicon/ trong thư mục public/. Trong trường hợp trong file config.php tồn tại biến assets_version sẽ tự động thêm version vào đằng sau các file CSS, JS
  • Helper Function: storage_url - Need config storage_url item in config.php file. VD: $config['storage_url'] = 'https://storage.nguyenanhung.com/';
  • Helper Function: go_url - Need config go_url item in config.php file. VD: $config['go_url'] = 'https://go.nguyenanhung.com/';
  • Helper Function: assets_mobile
  • Helper Function: assets_themes
  • Helper Function: assets_themes_dashboard
  • Helper Function: assets_themes_comingsoon
  • Helper Function: assets_themes_error

Common Helper

  • Helper Function: isEmpty - Kiểm tra 1 input đầu vào xem có phải là rỗng hay không

Debug Helper

  • Helper Function: dd
  • Helper Function: ddd

File Helper

  • Helper Function: formatSizeUnits - Hàm format 1 int đầu vào thành 1 format để dễ đọc dung lượng file
  • Helper Function: genarateFileIndex - Tự động tạo nội dung file index.html
  • Helper Function: genarateFileHtaccess - Tự động tạo nội dung file .htaccess
  • Helper Function: genarateFileReadme - Tự động tạo nội dung file README.md
  • Helper Function: makeNewFolder - Hàm tạo 1 thư mục mới và genre sẵn trong đó 3 file: README.md, index.html, .htaccess
  • Helper Function: new_folder - Chức năng tương tự với hàm makeNewFolder

HTML Helper

  • Helper Function: meta_dns_prefetch
  • Helper Function: meta_property
  • Helper Function: tachPage
  • Helper Function: stripHtmlTag
  • Helper Function: strip_only_tags
  • Helper Function: tracking_google_analytics

Image Helper

  • Helper Function: google_image_resize
  • Helper Function: google_image_proxy_dns_prefetch
  • Helper Function: wordpress_proxy
  • Helper Function: wordpress_proxy_dns_prefetch

IP Helper

  • Helper Function: getIPAddress - Hàm lấy ra địa chỉ IP thực tế của người dùng
  • Helper Function: validateIP - Hàm validate 1 string có phải IP ko. TRUE nếu đó là IP
  • Helper Function: validateIPV4 - Hàm validate 1 string có phải IP v4 ko. TRUE nếu đó là IP
  • Helper Function: validateIPV6 - Hàm validate 1 string có phải IP v6 ko. TRUE nếu đó là IP
  • Helper Function: getIpInformation - Khởi tạo 1 request đến IP-API để lấy thông tin của địa chỉ IP

Meta Helper

  • Helper Function: setupMetaDnsPrefetch - Hàm hỗ trợ gen ra 1 đoạn HTML Dns Prefetch tương tự <link href='//data.nguyenanhung.com/' rel='dns-prefetch' />

NanoID Helper

Helper này sử dụng gói hidehalo/nanoid-php để gen ra 1 mã random Id nhỏ, nhẹ và an toàn hơn nhiều so với UUID.

Hiện tại việc sử dụng nanoid đang là xu hướng so với uuid truyền thống

Để sử dụng được gói này, cần cài packages nguyenanhung/nanoid-helper bằng lệnh composer require nguyenanhung/nanoid-helper

  • Helper Function: randomNanoId

Paging Helper

  • Helper Function: view_paginations
  • Helper Function: view_more
  • Helper Function: select_page
  • Helper Function: get_paginations_title
  • Helper Function: get_paginations_number

Text Helper

  • Helper Function: convert_string_utf8_to_vietnamese
  • Helper Function: clean_allowfullscreen
  • Helper Function: clean_text
  • Helper Function: clean_title
  • Helper Function: clean_text_mobile
  • Helper Function: bodautru
  • Helper Function: bodaunhay
  • Helper Function: searchs_snippets
  • Helper Function: tags_snippets
  • Helper Function: tags_clean

TinyUrl Helper

  • Helper Function: short_url_with_tinyurl - Hàm hỗ trợ shortUrl dựa trên API của TinyURL

URL Helper

  • Helper Function: share_url
  • Helper Function: encodeId_Url_byHungDEV
  • Helper Function: decodeId_Url_byHungDEV
  • Helper Function: convertToLatin
  • Helper Function: specialCharToNormalChar
  • Helper Function: alphabetOnly
  • Helper Function: boDauTiengViet
  • Helper Function: removeSpecialChar
  • Helper Function: getPermalinksSEO

UUID Helper

  • Helper Function: generate_uuid_v4 - Hàm tạo ra 1 chuỗi UUID v4 ngẫu nhiên

XML Helper

  • Helper Function: parse_sitemap_index

Maintainer & Supporter

STT Name Email Github
1 Hung Nguyen dev@nguyenanhung.com @nguyenanhung