HTTP Library



( ZN >= 3.0.0 )

It was created to use the $ _GET , $ _POST , $ _EVN , $ _SERVER , and $ _REQUEST super globals using the Method :: library . Although it performs the same function as the Method :: library, there are slight differences in the use of the functions.

 

# Methods


Bool isInvalidRequest ( Void )
Bool isAjax ( Void )
String browserLang ( String $ default = 'en' )
String code ( Int $ code = 200 )
String message ( String $ message )
this input ( String $ input )
this name ( String $ name )
this value ( Mixed $ value )
Mixed select ( String $ name )
Bool insert ( String $ name , $ value )
Bool delete ( String $ name )

 

# IsInvalidReqest ( ZN >= 4.2.4 )


The request made to the page checks whether there is a valid request. Security measures can usually be taken to ensure that the form is requested using the pages where the forms are posted.

Parameters

void
return Bool

Use of

if( Http::isInvalidRequest() === false )
{
    Import::view('page');
}
else
{
    redirect('sorry/invalidrequest');
}

 

# IsAjax ( ZN >= 3.1.2 )


The request to the page checks whether ajax requests. You can use this method at the beginning of your ajax submission to have ajax code.

Parameters

void
return Bool

Use of

if( Http::isAjax() === false )
{
    echo 'Invalid Ajax Process'; exit;
}

 

# BrowserLang ( ZN >= 3.0.1 )


Gives the active language abbreviation of the current web browser. If no language is found, the value returned as the parameter is returned.

Parameters

String $ default = 'en' Default if no language is found.
return String

Use of

echo Http::browserLang();
most

 

# Code ( ZN >= 3.0.0 )


Used to return error messages according to error code.

Parameters

Int $ code = 200 Message code.
return String

Use of

echo Http::code(100);
echo Http::code(200);
100 Continue
200 OK 

 

# Message ( ZN >= 3.0.0 )


Used to return error messages according to the error message.

Parameters

String $ Message Key in the message.
return String

Use of

echo Http::message('continue');
echo Http::message('ok');
100 Continue
200 OK 

 

# Input ( ZN >= 3.0.0 )


It was created to use global variables $ _GET , $ _POST , $ _EVN , $ _SERVER , and $ _REQUEST . The reason for the development of this method is security.

Parameters

String $ input Which global is to be used.
Options get , post , env , server , request
return this

Use of

Http::input('post')->insert('example', 'Example Value');

echo Http::input('post')->select('example');
Example Value 

 

# Name ( ZN >= 3.0.0 )


It is used to specify the name of the entry. It is an optional method. Usage is not compulsory .

Parameters

String $ name The name of your entry.
return this

Use of

Http::input('post')->name('example')->value('Example Value')->insert();

echo Http::input('post')->name('example')->select();
Example Value 

 

# Value ( ZN >= 3.0.0 )


Used to specify the value of the input. It is an optional method. Usage is not compulsory .

Parameters

Mixed $ Value Input value.
return this

Use of

Http::input('post')->name('example')->value('Example Value')->insert();

echo Http::input('post')->name('example')->select();
Example Value 

 

# Select ( ZN >= 3.0.0 )


Used to select input.

Parameters

String $ name The name of your entry.
return Mixed

Use of

echo Http::input('post')->select('example');
Example Value 

 

# Insert ( ZN> = 3.0.0 )


Used to add a boolean value.

Parameters

String $ name The name of your entry.
Mixed $ Value Input value.
return Bool

Use of

echo Http::input('post')->insert('example', 'Example Data');

 

# Delete ( ZN> = 3.0.0 )


Used to delete the entry.

Parameters

String $ name The name of your entry.
return Bool

Use of

echo Http::input('post')->delete('example');