A few basic helpers when used with Codeigniter 3.
Many other code or frameworks can be included, but there are some funded requirements framework CodeIgniter , but does not affect the efficiency of use.
In case of integrating this package into frameworks and sources other than CodeIgniter , you need to install additional nguyenanhung/polyfill-codeigniter-built-in package for the best use
A few frameworks I often use with this package are
Below is a list of Helper supported in this library
generateAlphaId - The function helps create an unique 4ew68i32xc ID based on 1 int input like 1234arrayToObject - The function helps convert 1 array into 1 object to_array - Converts A String or An Object to An Array. arrayToXml - The function helps to convert array into a XML chain removeArrayElementWithValue - Remove a value in Array by Key and Value arrayRecursiveDiff - Diff 2 Array in recursive arrayIsAssoc - detects if the given value is an associative array. arrayFirstElement - Returns the first element of an array. arrayLastElement - Returns the last element of an array. arrayGetElement - Gets A Value in An Array by dot notation for the keys. arraySetElement - Set A Value in An Array Using The Dot Notation.assets_url - The function takes out Assets URL, conditions to exist assets folders in public/ . In the case in the config.php file, the variable of assets_version will automatically add the version to the back of the CSS, JS files static_url - The function takes out the Static Resource URL, the condition of config_item('static_url') in the website of the website. In the case in the config.php file, the variable of assets_version will automatically add the version to the back of the CSS, JS files templates_url - The function removes Assets URL, conditions for existence of templates in public public/ . In the case in the config.php file, the variable of assets_version will automatically add the version to the back of the CSS, JS files editor_url - The function removes Assets URL, conditions for the existence of assets/editors/ Editors public/ . In the case in the config.php file, the variable of assets_version will automatically add the version to the back of the CSS, JS files favicon_url - The function removes Assets URL, conditions for the existence of assets/favicon/ in the public public/ . In the case in the config.php file, the variable of assets_version will automatically add the version to the back of the CSS, JS files favicon_html_tag - The function took out the HTML segment showing Favicon based on the URL Folder Favicon input storage_url - Need config storage_url item in config.php file. Example: $config['storage_url'] = 'https://storage.nguyenanhung.com/'; go_url - Need config go_url item in config.php file. Example: $config['go_url'] = 'https://go.nguyenanhung.com/'; assets_mobile - Take out the assets of the Mobile interface (in fact rarely used, maintain for old projects) assets_themes - Take out the assets of the PC interface (actually rarely used, maintain for old projects) assets_themes_dashboard - Take out the assets of the Dashboard interface (actually rarely used, maintained for old projects) assets_themes_comingsoon - Take out the assets of the Coming Soon interface (actually rarely used, maintained for old projects) assets_themes_error - Take out the assets of the Error interface (actually rarely used, maintained for old projects) cdn_js_url - Resource JS, CSS from CloudFlare's CDN google_fonts_url - Resource Google Font bootstrapcdn_url - Resource CDN from BootstrapblogspotDescSortWithPublishedTime - Arrange Feed data from Blogspot by Published Time blogspotUSort - Arrange Feed data from blogspot by USTR and Published Time by DESC blogspotFormatInformationItem - Format Data input Blogspot ItembytesHumanFormat - Display Format content easy to read from byte databear_framework_default_get_data_chart bear_framework_default_get_data_chart_reportisEmpty - Checking 1 input input to see if it is empty or not defaultCompressHtmlOutput - Compress Html Output, Default Configure generateRandomUniqueId - Create a random Unique ID chain, use Uuid generateRandomNanoUniqueId - Create a random Unique ID chain, use Nanoidgenerate_list_id_with_parent_id - Create 1 list of IDs, which contains sub -dependent sets of that ID. For example: Used in case you want to display the content of the category Father and the Category children in the same page contentdayFloor - The function takes out the distance between 2 days getZuluTime - The function takes out the date parameter according to Zulu Time iso_8601_utc_time - Similar to Getzulutime getYesterday - The function was the day before smart_bear_date_range - Take out a piece of data containing days by distance format_datetime_vn - Format day information in Vietnam style get_start_and_end_date_for_week - Take out the first and last day of 1 weekThese functions use debug
dd ddd dumpbear_get_env - The function takes value from the .env file.bear_framework_basic_clean_str - Simple Clean Input Stringwidget_facebook_div_init - The function produces <div id="fb-root"></div> widget_facebook_script_init - Flower creates SCRIPT INIT section in case of embedded JS Facebook widget_facebook_comments - The function creates a Facebook comment frame widget_facebook_share_button - Function to create Facebook Share button widget_facebook_like_button - Function creates like Facebook button widget_facebook_save_button - The function creates a button to save the content to FacebookformatSizeUnits - Format 1 int input function into 1 format for easy reading file capacity generateFileIndex - Automatically creates index.html file content generateFileHtaccess - Automatically creating .htaccess file content. generateFileReadme - Automatically create README.md file content.md makeNewFolder - Function to create a new folder and Generate available in which 3 files: README.md , index.html , .htaccess . Create additional .gitkeep files if the second parameter is transmitted as True new_folder - The function is similar to the makeNewFolder function scan_folder - Scan and remove the list of data information in the folder getAllFileSizeInFolder - Get all file size in folder getAllFileInFolder - Get all file in folderjoin_value_multiple - JOIN VALUE MULTIPLEbear_framework_show_gravatar - Show Gravatar URL with custom size and Usernamemeta_dns_prefetch meta_property tachPage stripHtmlTag strip_only_tags tracking_google_analytics tracking_google_gtag_analytics_default bear_framework_show_jsonld_scriptgoogle_image_resize - Resize Image using Google Gadget Proxy google_image_proxy_dns_prefetch - The function provides DNS Prefetch in the case of using google_image_resize wordpress_proxy - Resize & Cache Image using WordPress Proxy wordpress_proxy_dns_prefetch - The function provides DNS Prefetch in case of using wordpress_proxy bear_framework_image_url - Format Image URL - For Bear Framework create_image_thumbnail - Create thumbnail - exclusively for Bear FrameworkgetIPAddress getIPAddressByHaProxy - The function takes out the actual IP address of the user but in the server is running HA Proxy, through HTTP_X_FORWARDED_FOR variables validateIP - Validate 1 String function is an IP. True if it's ip validateIPV4 - Validate 1 String function is an IP V4. True if it's ip validateIPV6 - Validate 1 String function is an IP V6. True if it's ip getIpInformation - Initial 1 request to IP-API to get information of the IP addresssetupMetaDnsPrefetch - a function that supports a gene to produce a paragraph HTML DNS Prefetch Similar to <link href='//data.nguyenanhung.com/' rel='dns-prefetch' />money_number_format - Format Money Curreniscy Will Detect The Current Locale This Helper uses hidehalo/nanoid-php package to make genes produce a small, lightweight and safer Random ID code than UUID.
Currently using nanoid is a trend compared to traditional uuid
To use this package, it is necessary to install Packages nguyenanhung/nanoid-helper with composer require nguyenanhung/nanoid-helper command
randomNanoIdconvertNumberToWords - Converting effects in some words, for example 123 into One Hundred Twenty Threeview_paginations view_more select_page get_paginations_title get_paginations_number bear_framework_news_view_pagination - Separate page for Bear Projectplaceholder_imgsendSimpleGetRequest - Proceed to execute a simple request using curl with GET method sendSimpleRestfulExecuteRequest - Execute 1 Simple Request to Restful API using curl bear_post_async_request - Make an Asynchronous Post Request - Make an asynchronous post requirement within the site without waiting for response => No effect, no delaying process is running get_http_response_code - Get Httpponse Code with get_headersxssValidation - Validation input data is involved in XSS or not. This function does not have Escape, if you want, install more Packages nguyenanhung/securitylog_to_sentry - Logging on Sentry via Monolog HandlercountStringsInText - The number of words counting in the text findMiddleInString - The function takes the string in the middle of the starting chain and the ending string str_insert - Insert One or More Strings Into Another String on A Defined Position. str_between - Return the content in a string between a left and right element. str_after - Return the part of a string after a given value. str_before - Get the part of a string before a given value. str_limit_words - Limited the number of words in a string. Put value of $ end to the string end. str_limit_characters - Limited the number of Characters in a string. Put value of $ end to the string end. str_contains - Test if a string contains a given element str_ignore_contains - Test if a string contains a given element. Ignore Case Sensitivity. str_starts_with - Determine If A Given String Starts with a given substring. str_ignore_starts_with - Determine If A Given String Starts with a Given Substring. Ignore Case Sensitivity. str_ends_with - Determine If A Given String Ends with A Given Substring. str_ignore_ends_with - Determine if a given string ends with a given substring. Ignore Case Sensitivity. str_after_last - Return the part of a string after the lasting of a given search value. hide_characters - Convert nguyenanhung to ngxyexanxunx , Acts as a very simple and predictable character encun.convert_string_utf8_to_vietnamese clean_allowfullscreen clean_text clean_title clean_text_mobile bodautru bodaunhay searchs_snippets tags_snippets tags_clean highlight_keyword_phrase - Highlights A Keyword within a Text String format_keyword_highlight_phrase - Format keyword for function highlight_keyword_phraseshort_url_with_tinyurl - Shorturl supporting function based on Tinyurl's APIencodeId_Url_byHungDEV decodeId_Url_byHungDEV convertToLatin specialCharToNormalChar alphabetOnly boDauTiengViet removeSpecialChar getPermalinksSEO share_url - Create out the standard URL Share for MXH, very good support for SEO private_url - Customize function exclusively for framework Codeigniter private_api_url - Customize dedicated to framework Codeigniter cdn_url - Customize dedicated to framework Codeigniter images_url - Customize function exclusively for framework Codeigniter audio_url - Customize dedicated to framework Codeigniter append_params_into_url - Append Parameters to URL append_query_string_to_current_url - Get Current URL Including Query String - Customize dedicated to framework Codeignitergenerate_uuid_v4 - The function creates a random Uuid V4 stringcheck_vn_province_code - Check Provin Code of some provinces and cities of Vietnamconvert_video_embed_vimeo - Convert Video URL to Embed Vimeo (Little use, saved here because there are many old projects you are using) convert_video_embed_dailymotion - Convert Video URL to Embed Dailymotion (Little use, saved here because there are many old projects in use) convert_video_embed_youtube - Convert Video URL to Embed YouTube (Little use, saved here because there are many old projects in use) convert_video_v_embed_youtube - Convert Video URL to Embed YouTube (Little use, saved here because there are many old projects in use) youtube_image_thumbnail - Convert YouTubeid to Youtube thumbnail URLparse_sitemap - The function supports rendering content for sitemap parse_sitemap_index - The function supports rendering content for sitemap index xml_convert - converting reserved xml characters to enter xml_get_value - GET Value from XML String xml_to_json - Convert xml string to jsonClass provides a quick method to call the API of the standard Restful
SimpleRestful::execute($url, $type, $data)Class provides a quick method to call to perform the requests outside, using simple curls, for example
<?php
use nguyenanhung CodeIgniter BasicHelper SimpleCurl ;
$ curl = new SimpleCurl ();
$ curl -> setUrl ( ' https://example.com ' )
-> setPost ( array ( ' field1 ' => ' value1 ' ))
-> createCurl ();
$ response = $ curl -> getResponse ();Class provides some ways to help handle images
googleGadgetsProxy - Create a resize URL using Google Gadgets Proxy googleGadgetsProxyDnsPrefetch - Setup DNS Prefetch for Google Gadgets Proxy, to increase query speed wordpressProxy - Create a resize URL using WordPress Proxy wordpressProxyDnsPrefetch - Setup DNS Prefetch for WordPress Proxy, to speed up query createThumbnail - Thumbnail function, to use need to install more nguyenanhung/image package createThumbnailWithCodeIgniterCache - Thumbnail function combined with Codeigniter's cache library, to use, need to install more nguyenanhung/image package | Stt | Name | Website | Github | |
|---|---|---|---|---|
| 1 | Hung Nguyen | [email protected] | https://nguyenanhung.com | @nguyenanhung |