Buffer Library



( ZN >= 2.0.0 )

Class created for buffer usage.

 

# Methods


String file ( String $ file , Array $ data = NULL )
Mixed function ( Callable $ func , Array $ params = [] )
Mixed callback ( Callable $ func , Array $ params = [] )
Bool insert ( String $ name , Mixed $ data , Array $ params = [] )
Mixed select ( String $ name )
Bool delete ( Mixed $ name )

 

# File ( ZN >= 2.0.0 )


Used to buffer the contents of a file. With this method, the file content can be used by directly importing it into the buffer instead of printing it on the screen.

Parameters

String $ file File path.
Array $ data = NULL buffered .php Extension is used to send data to a file.
return String

uses

$data = Buffer::file('Dosya/test.php');

echo $data;

Data Send ( ZN> = 5.3.2 )

Import library has the same function as sending data. .phpUsed to send data to the file with the uploaded extension.

$data = Buffer::file('Dosya/test.php', ['data' => 'Example Data']);

echo $data;

 

# Function ( ZN >= 2.0.0 ) / Callback ( ZN >= 3.0.6 )


It is used to buffer the output of methods.

Parameters

callable $ Function Function or function name.
Array $ parameters = [] Function parameters.
return Mixed

uses

$data = Buffer::function(function(){ return 1; });
echo $data;
one
$data = Buffer::callback('get_defined_constants', [true]);
output($data);
$data = Buffer::function('get_defined_functions');
output($data);

 

# Insert ( ZN >= 2.0.0 )


Used to add data to the buffer.

Parameters

String $ name Data name.
Mixed $ data Data to be taken to the tampon.
Array $ parameters = [] Function parameters.
return Mixed

uses

Buffer::insert('veri1', 'Değer');
Buffer::insert('veri2', function(){ return 1; });
Buffer::insert('veri3', 'get_defined_constants', [true]);
Buffer::insert('veri4', 'Dosya/index.html');

 

# Select ( ZN >= 2.0.0 )


The name of the given choice.

Parameters

Mixed $ name Data name.
return Mixed

uses

echo Buffer::select('veri1');

 

# Delete ( ZN> = 2.0.0 )


The name of the data or data to be deleted.

Parameters

Mixed $ name The name of the data or data.
return Bool

uses

echo Buffer::delete('veri1');

Delete Multiple Data ( ZN> = 3.1.3 )

To delete more than one data, you can enter the parameter array data type.

echo Buffer::delete(['veri1', 'veri2']);