Examples
A quick look through the index.php or the include.php files of any module will quickly show many functions that are used over and over in module development.
In PhpStorm you can get the documentation for that function via the docblock reference lookup feature. Ctrl+q while looking at the function.
eg: jrCore_checktype()
jrCore_checktype is a function that is used to verify that the contents of the variable are what is expected.
The jrCore_checktype function takes the variable as its first parameter and the checktype as its second.
The types of checktype that are available are:
*
allowed_html - Ensures value is a string and is allowed to contain HTML allowed in the profile's quota
*
core_string - the numbers 0-9, letters a-z and _ (underscore)
*
date - a valid date
*
domain - a valid domain name (no www)
*
email - a valid email address
*
float - a floating point number
*
hex - a hexadecimal value
*
ip_address - a valid IP Address
*
is_true - boolean TRUE or int or string "1"
*
md5 - valid 32 character long MD5 hash
*
multi_word - a string with more than 1 word
*
not_empty - a string of any length
*
number - an integer
*
number_nn - an integer greater than or equal to zero (0)
*
number_nz - an integer greater than or equal to one (1)
*
onoff - either "on" or "off"
*
price - a price in D.CC format
*
printable - UTF-8 characters with HTML stripped
*
sha1 - a 40 character SHA1 hash
*
string - a string that does not contain HTML or hidden characters
*
url - a valid URL
*
url_name - the numbers 0-9, letters a-z, _ and - (dash)
*
user_name - the numbers 0-9, letters a-z, _ (underscore), - (dash) and spaces
*
file_name - string that can contain a . (dot)
*
yesno - "yes" or "no"
*
json - check if a string is json or not
We can see this too when we use the
ctrl+q option on the function