Application
Interfaces, Classes, Traits and Enums
- DB
- Connection class use for CRUD opration and work with MySQL database
- File
- File class for work with files and folders
- Validate
- Validate class have many method for sanitizing validating and increase seafety of your inputs
Table of Contents
- DB_NAME = ''
- Database config variable
- HOST_NAME = 'localhost'
- Database config variable
- TIME_ZONE = "asia/tehran"
- Set your default time zone
- USER_NAME = 'root'
- Database config variable
- USER_PASSWORD = ''
- Database config variable
- hr() : string
- Drop a horizontal line
- br() : void
- Drop a break line
- d() : void
- Drop a varible for showing value
- dd() : void
- Drop and die a variable for showing value
- js() : void
- Add javaScript code to HTML page
- redirect() : void
- Change URL path with PHP
- is_post() : bool
- Check request method is POST?
- is_get() : bool
- Check request method is GET?
- session() : void
- Return session value if set
- e_session() : void
- echo session value if set
- randomatic() : bool
- Creare a random string with your pattern and length
- check_cookie() : bool
- Chck cookie on ro off ?
- cookie() : void
- Return Cookie value if it's set
- my_address() : string
- Get url
- error() : void
- set error session
Constants
DB_NAME
Database config variable
public
string
DB_NAME
= ''
DB_NAME Database name
HOST_NAME
Database config variable
public
string
HOST_NAME
= 'localhost'
HOST_NAME Database server(host) name
TIME_ZONE
Set your default time zone
public
mixed
TIME_ZONE
= "asia/tehran"
@var string TIME_ZONE Set default time zone
USER_NAME
Database config variable
public
string
USER_NAME
= 'root'
USER_NAME User name
USER_PASSWORD
Database config variable
public
string
USER_PASSWORD
= ''
USER_PASSWORD User pass
Functions
hr()
Drop a horizontal line
hr() : string
Tags
Return values
string —br()
Drop a break line
br() : void
Tags
Return values
void —d()
Drop a varible for showing value
d([ $data = "d function stop" ][, int|null $line_number = null ][, int|null $file_name = null ]) : void
Parameters
Tags
Return values
void —dd()
Drop and die a variable for showing value
dd([ $data = "d function stop" ][, int|null $line_number = null ][, int|null $file_name = null ]) : void
Parameters
Tags
Return values
void —js()
Add javaScript code to HTML page
js(string $input) : void
Parameters
- $input : string
Tags
Return values
void —redirect()
Change URL path with PHP
redirect([string $url = "/" ][, int $statusCode = 303 ]) : void
Parameters
- $url : string = "/"
- $statusCode : int = 303
Tags
Return values
void —is_post()
Check request method is POST?
is_post() : bool
Tags
Return values
bool —is_get()
Check request method is GET?
is_get() : bool
Tags
Return values
bool —session()
Return session value if set
session([ $name = null ][, $value = null ]) : void
Parameters
Return values
void —e_session()
echo session value if set
e_session([ $name = null ]) : void
Parameters
Return values
void —randomatic()
Creare a random string with your pattern and length
randomatic([string $case = "a" ][, int $length = 1 ]) : bool
Parameters
- $case : string = "a"
-
Deafault is 'A' all option : "A|N|L|U|NL|NU|LU"
- $length : int = 1
-
Length of string default is '1'
Tags
Return values
bool —| string Return false or string pattern
check_cookie()
Chck cookie on ro off ?
check_cookie() : bool
Tags
Return values
bool —cookie()
Return Cookie value if it's set
cookie(string $cookie_name) : void
Parameters
- $cookie_name : string
-
Name of cookie
Tags
Return values
void —my_address()
Get url
my_address([bool $url = false ]) : string
Parameters
- $url : bool = false
Tags
Return values
string —error()
set error session
error([ $name = null ][, $value = null ]) : void