Functions |
auth_prerequisite |
Check and get the authentication configuration settings |
auth_create |
Create Authentication object
This function is overridable from the custom helpers/auth_helper.php |
auth_getUserInfo |
Get user record from db to create auth session
This function is overridable from the custom helpers/auth_helper.php |
auth_namespace |
Get the namespace for the authentication object
The Auth session name can be different upon directory (namespace)
But… |
auth_get |
Get the authenticated user object from Session |
auth_set |
Set the authenticated user object to Session |
auth_clear |
Clear the authenticated user object from session |
auth_isAnonymous |
Check if a user is not authenticated |
auth_isLoggedIn |
Check if a user is authenticated |
auth_permissions |
Get the permissions of a particular role
This function is overridable from the custom helpers/auth_helper.php |
auth_role |
Check if the authenticated user has the specific user role
This function is overridable from the custom helpers/auth… |
auth_roles |
Check if the authenticated user has the specific user role(s)
This function is overridable from the custom helpers/auth… |
auth_can |
Check if the authenticated user has a particular permission
This function is overridable from the custom helpers/auth… |
db_engine |
Return the database engine of the given namespace |
db_host |
Return the database host name of the given namespace |
db_name |
Return the database name of the given namespace |
db_user |
Return the database username of the given namespace |
db_prefix |
Return the database table prefix of the given namespace |
db_collation |
Return the database collation of the given namespace |
db_switch |
Switch to the given database from the currently active database |
db_close |
Closes a previously opened database connection |
db_prq |
Make the generated query returned from the query executing functions
such as db_query, db_update, db_delete, etc.… |
db_query |
Perform a query on the database |
db_queryStr |
Get the last executed SQL string or one of the executed SQL strings by providing the index |
db_error |
Returns a string description of the last error |
db_errorNo |
Returns the error code for the most recent MySQLi function call |
db_numRows |
Gets the number of rows in a result |
db_fetchArray |
Fetch a result row as an associative, a numeric array, or both |
db_fetchAssoc |
Fetch a result row as an associative array |
db_fetchObject |
Returns the current row of a result set as an object |
db_insertId |
Returns the auto generated id used in the last query |
db_insertSlug |
Returns the generated slug used in the last query |
db_select |
Initialize a query builder to perform a SELECT query on the database |
db_count |
Perform a count query on the database and return the count |
db_max |
Initialize a query builder to perform a MAX query on the database |
db_min |
Initialize a query builder to perform a MIN query on the database |
db_sum |
Initialize a query builder to perform a SUM query on the database |
db_avg |
Initialize a query builder to perform an AVG query on the database |
db_fetch |
Perform a query on the database and return the first field value only. |
db_fetchResult |
Perform a query on the database and return the first result row as object |
db_extract |
Perform a query on the database and return the array of all results |
db_table |
Get the full table name with prefix |
db_tableHasSlug |
Check the table has slug field |
db_tableHasTimestamps |
Check the table has timestamp fields |
db_save |
Handy db insert/update operation |
db_insert |
Handy MYSQL insert operation |
db_update |
Handy MYSQL update operation |
db_delete |
Handy MYSQL delete operation for single record.
It checks FK delete RESTRICT constraint, then SET deleted if it cannot… |
db_delete_multi |
Handy MYSQL delete operation for multiple records |
db_truncate |
Truncate the table |
db_setForeignKeyCheck |
Set foreign key check |
db_enableForeignKeyCheck |
Enable foreign key check |
db_disableForeignKeyCheck |
Disable foreign key check |
db_and |
Build the SQL WHERE clause AND condition from array of conditions |
db_or |
Build the SQL WHERE clause OR condition from array of conditions |
db_transaction |
Start a new transaction |
db_commit |
Commit the current transaction, making its changes permanent. |
db_rollback |
Roll back the current transaction, canceling its changes. |
db_raw |
Get raw expression string |
db_find |
Get a single entity result where the primary key matches the value passed in as the second parameter for the table name… |
db_findOrFail |
Get a single entity result where the primary key matches the value passed in as the second parameter for the table name… |
db_findWithPager |
Get array of data row objects with pagination result |
db_findBy |
Get data of a table by condition |
db_findOneBy |
Get one record of a table by condition |
db_findOneByOrFail |
Get one record of a table by condition or throw 404 if not found |
db_findAll |
Get all records for a table |
db_findColumn |
Get a column result value of a single entity result |
form_init |
Initialize form |
form_set |
Setter for the class properties |
form_token |
Form token generation |
form_validate |
Form token validation |
form_respond |
AJAX form responder |
form_value |
Permits you to set the value of an input or textarea.
Allows you to safely use HTML and characters such as quotes… |
form_htmlValue |
Permits you to set the value to a rich text editor or any input where HTML source is required to be rendered.
Allows… |
form_selected |
Allow you to select the option of a drop-down list. |
form_checked |
Allow you to select a checkbox or a radio button |
_t |
Translation helper
It returns a translated string if it is found; Otherwise, the given string itself |
_tc |
Get translation contents from the content file located in i18n/ctn/[lang]/*.[lang]
Example, i18n/ctn/en/about.en |
route_search |
Search the physical directory according to the routing path |
route_path |
Get the routing path
Alias `_r()` |
route_url |
Return the absolute URL path appended the query string if necessary
Alias `_url()` |
route_updateQueryStr |
Update the route path with the given query string |
route |
Initialize a route to define |
route_group |
Define route group |
route_name |
Get the current route name |
route_equal |
Check if the current route is equal to the given uri or route name |
route_start |
Check if the current route uri is started with the given uri |
route_contain |
Check if the current route uri contains the given URI or list of URIs |
route_except |
Check if the current route uri is in th exception list |
_arg |
Return a component of the current path.
When viewing a page http://www.example.com/foo/bar and its path would be "foo… |
_get |
Sanitize input values from GET |
_post |
Sanitize input values from POST |
_put |
Accessing PUT request data |
_patch |
Accessing PATCH request data |
_xss |
Strips javascript tags in the value to prevent from XSS attack |
_sanitize |
Sanitize strings |
session_set |
Set a message or value in Session using a name |
session_get |
Get a message or value of the given name from Session |
session_delete |
Delete a message or value of the given name from Session |
flash_set |
Set the flash message in session
This function is overridable from the custom helpers/session_helper.php |
flash_get |
Get the flash message from session and then delete it
This function is overridable from the custom helpers/session… |
cookie_set |
Send a cookie
Convenience method for setcookie() |
cookie_get |
Get a cookie
Convenience method to access $_COOKIE[cookiename] |
cookie_delete |
Delete a cookie
Convenience method to delete $_COOKIE['cookiename'] |
_app |
Set/Get a global variable/object |
_version |
Returns the current PHPLucidFrame version |
_minifyHTML |
Minify and compress the given HTML according to the configuration `$lc_minifyHTML` |
_dir |
Get a full path directory |
_loader |
Auto-load a library, script or file |
_unloader |
Removing a library, script or file from auto-load |
_autoloadDir |
Autoload classes from directory |
_script |
Declare global JS variables
Hook to implement `__script()` at app/helpers/utility_helper.php |
_addJsVar |
Passing values from PHP to Javascript making available to `LC.vars` |
_js |
JS file include helper |
_css |
CSS file include helper |
_img |
Get the image file name with absolute web path |
_image |
Display an image fitting into the desired dimension
It expects the file existing in one of the directories `./files` … |
_pr |
Convenience method for `print_r`.
Displays information about a variable in a way that's readable by humans.
If given a… |
_dpr |
Convenience method for `print_r` + `die`.
Displays information about a variable in a way that's readable by humans.
If… |
_dump |
Convenience method for `var_dump`.
Dumps information about a variable |
_h |
Convenience method for htmlspecialchars. |
_lang |
Get the current site language code |
_getLang |
Get the language to process
Read "lang" from query string; if it is not found, get the default language code
Basically,… |
_defaultLang |
Get the default site language code |
_langs |
Get array of the defined languages |
_queryLang |
Get the current site language code by converting dash (URL-friendly) to underscore (db-friendly) |
_urlLang |
Get the current site language code by converting underscore (db-friendly) to dash (URL-friendly) |
_defaultQueryLang |
Get the default site language code by converting dash to underscore |
_langName |
Get the current site language name of the given language code
If the site is multilingual, return empty
If no given… |
_multilingual |
Get the current site is multilingual or not |
_protocol |
Get the server protocol
For example, http, https, ftp, etc. |
_ssl |
Check SSL or not |
_r |
Get the current routing path
For example, |
_rr |
The more realistic function to get the current routing path on the address bar regardless of RewriteRule behind
For… |
_cr |
Get the clean routing path without the query string
For example, `example.com/post/1/edit` would return `post` |
_url |
Get the absolute URL path |
_self |
Get the absolute URL path |
_header |
Send HTTP header |
_redirect |
Header redirect to a specific location |
_redirect301 |
Header redirect to a specific location by sending 301 status code |
_page401 |
Display 401 page |
_page403 |
Display 403 page |
_page404 |
Display 404 page |
_error |
Display error page |
_isRewriteRule |
Check if the current routing is a particular URL RewriteRule processing or not |
_canonical |
Setter for canonical URL if the argument is given and print the canonical link tag if the argument is not given |
_hreflang |
Print hreflang for language and regional URLs |
_getLangInURI |
Check if the URI has a language code and return it when it matches
For example, |
_validHost |
Validate that a hostname (for example $_SERVER['HTTP_HOST']) is safe. |
_title |
Get the page title glued by a separator |
_filterArrayEmpty |
Filters elements of an array which have empty values |
_notEmpty |
Check the given value is not empty |
_breadcrumb |
Generate breadcrumb by a separator |
_shorten |
Shorten a string for the given length |
_fstr |
Format a string |
_fnum |
Format a number |
_fnumSmart |
Format a number in a smarter way, i.e., decimal places are omitted when necessary.
Given the 2 decimal places, the… |
_fnumReverse |
Remove the number formatting (e.g., thousand separator) from the given number |
_fdate |
Format a date |
_fdatetime |
Format a date/time |
_ftimeAgo |
Display elapsed time in wording, e.g., 2 hours ago, 1 year ago, etc. |
_msg |
Print or return the message formatted with HTML |
_filesize |
Find the size of the given file. |
_randomCode |
Generate a random string from the given array of letters. |
_slug |
Generate a slug of human-readable keywords |
_sqlDate |
Return the SQL date (Y-m-d) from the given date and format |
_encrypt |
Encrypts the given text using security salt if mcrypt extension is enabled, otherwise using md5() |
_decrypt |
Decrypts the given text using security salt if mcrypt extension is enabled,
otherwise return the original encrypted… |
_cipher |
Get current cipher method |
_meta |
Simple quick helper function for <meta> tag attribute values |
_metaSeoTags |
Print SEO meta tags |
_mail |
Simple mail helper function
The formatting of the email addresses must comply with RFC 2822. Some examples are: |
_postTranslationStrings |
Get translation strings from the POST array
and prepare to insert or update into the table according to the specified… |
_getTranslationStrings |
Get translation strings from the query result
and return the array of `$i18n[fieldName][lang] = $value` |
_isBot |
Detect the current page visited by a search bot or crawler |
_write |
Write output |
_writeln |
Write output with line feed (\n) |
_indent |
Write spacer for indentation purpose |
_consoleCommand |
Simple helper to create an instance of LucidFrame\Console\Command |
_consoleTable |
Simple helper to create an instance of LucidFrame\Console\ConsoleTable |
_consoleCommands |
Simple helper to get all registered commands |
_pager |
Simple helper to create Pager object |
_fileHelper |
Simple helper to create File object |
_asynFileUploader |
Simple helper to create AsynFileUploader object |
_middleware |
Simple helper to register a middleware |
_view |
Get view file |
_ds |
Return directories and file names glued by directory separator |
_isAjax |
Check if the request is an AJAX request |
_isHttpPost |
Check if HTTP request method is POST and has request data |
_json |
Header sent as text/json |
_jsonError |
Response error as JSON |
_requestHeaders |
Fetch all HTTP request headers |
_requestHeader |
Fetch a HTTP request header by name |
_requestMethod |
Get request method |
_isRequestMethod |
Check if the request method is the given one |
_addFormData |
Convert form data into js variable |
_nullFill |
Return a value or empty sign
Hook to implement `__nullFill()` at app/helpers/utility_helper.php |
_entity |
Get default entity object from the schema |
_addHeadStyle |
Add CSS file to be included in head section |
_addHeadScript |
Add JS file to be included in head section |
_en2myNum |
Convert English number to Myanmar number |
_arrayAssoc |
Check if array is associative or sequential |
_isContentType |
Check if HTTP header has the given content type |
_curl |
cURL helper |
form_select |
Helper to print select dropdown |
_mime2ext |
Get extension from MIME type |
validation_set |
Setter for Validation class properties |
validation_get |
Getter for Validation class properties |
validation_check |
Check all inputs according to the validation rules provided |
validation_addError |
Add an external error message |
validate_mandatory |
Checks that a string contains something other than whitespace |
validate_mandatoryOne |
Check one of the fields is required |
validate_mandatoryAll |
Check all the fields are not empty |
validate_notAllowZero |
Check a string or number is zero or not |
validate_alphaNumeric |
Checks that a string contains only integer or letters |
validate_alphaNumericSpace |
Checks that a string contains only integer, letters or spaces |
validate_alphaNumericDash |
Checks that a string contains only integer, letters or dashes |
validate_numeric |
Checks if a value is numeric. |
validate_numericDash |
Checks if the value contains numbers and dashes |
validate_numericSpace |
Checks if the value contains numbers and spaces |
validate_username |
Checks if the value does not contain special characters |
validate_naturalNumber |
Checks if a value is a positive integer starting from 1, 2, 3, and so on. No decimal |
validate_wholeNumber |
Checks if a value is a positive integer starting from 0, 1, 2, 3, and so on. No decimal. |
validate_integer |
Checks if a value is a positive or negative integer. |
validate_rationalNumber |
Checks if a value is an integer AND decimal. |
validate_positiveRationalNumber |
Checks if a value is a positive integer AND decimal |
validate_email |
Validates for an email address. |
validate_domain |
Checks if the value is a valid domain (alpha-numeric and dash only) |
validate_url |
Validates for a valid absolute web address |
validate_exactLength |
Checks that a string/array's length is equal to the specific length. |
validate_minLength |
Checks that a string length is greater than the specific length. |
validate_maxLength |
Checks that a string length is less than the specific length. |
validate_min |
Checks that a number is greater than the specific number. |
validate_max |
Checks that a number is less than the specific number. |
validate_between |
Checks that a number is within a specified range. |
validate_custom |
Used when a custom regular expression is needed.
Searches the value for a match to the regular expression given in… |
validate_fileExtension |
Validation of image file upload for allowed file extensions |
validate_fileMaxSize |
Validation of maximum file upload size |
validate_fileMaxDimension |
Validation of image file upload for max width and max height |
validate_fileExactDimension |
Validation of image file upload for exact width and height |
validate_fileMaxWidth |
Validation of image file upload for max width only |
validate_fileMaxHeight |
Validation of image file upload for max height only |
validate_ip |
Validation of an IP address. |
validate_date |
Validation of a date which checks if the string passed is a valid date.
**Allowed formats** |
validate_time |
Validation of a time which checks if the string passed is a valid time in 24-hour or 12-hour format or both
**Allowed… |
validate_datetime |
Validation of a date/time which checks if the string passed is a valid date and time.
**Allowed date formats** |
validate_unique |
Validation of a record uniqueness |
__autoloadHelper |
Autoload helper |
_schema |
Get schema definition file |
_i |
File include helper
Find files under the default directories inc/, js/, css/ according to the defined site directories … |
_host |
Get the host name or server name |
_cfg |
Convenience method to get/set a config variable without global declaration within the calling function |
_cfgOption |
Convenience method to get the value of the array config variable by its key |
_p |
Get the parameter value by name defined in `/inc/parameter/(development|production|staging|test).php` |
_g |
Convenience method to get/set a global variable |
_env |
Get the parameter value by name defined in `/inc/parameter/env.inc` |
_baseUrlWithProtocol |
Get base URL with protocol |
_baseDirs |
Get base directory list by priority |
_log |
Write log to file |
|
Namespaces |
LucidFrame |
none |
|