1. Go to this page and download the library: Download darkghosthunter/fluid library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
darkghosthunter / fluid example snippets
e_once 'path/to/fluid/Concerns/HasArrayAccess.php';
p';
// Optionally, these two together too
use DarkGhostHunter\Fluid\Fluid;
$emptyFluid = new Fluid;
$fluid = new Fluid(['foo' => 'bar']);
$otherFluid = Fluid::make(['foo' => 'bar']);
$otherEmptyFluid = Fluid::make();
use DarkGhostHunter\Fluid\Fluid;
$fluid = Fluid::fromJson('"{"foo":"bar"}"');
echo $fluid->foo; // 'bar'
use DarkGhostHunter\Fluid\Fluid;
class Water extends Fluid
{
// ...
}
$water = Water::make();
get_class($water); // 'Water'
use DarkGhostHunter\Fluid\Fluid;
class Water extends Fluid
{
/**
* My Custom "Make" static method
*
* @return \DarkGhostHunter\Fluid\Fluid|string
*/
public static function make()
{
return 'My Custom Logic';
}
}
echo Water::make(); // 'My Custom Logic'
use DarkGhostHunter\Fluid\FluidFillable;
$fluid = new FluidFillable(['foo' => 'bar', 'baz' => 'qux']);
$fluid->setFillable(['foo', 'baz']);
$fluid->alpha = 'bravo';
/*
* [!] DarkGhostHunter\Fluid\Exceptions\InvalidAttributeException
*
* Attribute [foo] in not set as fillable in FluidFillable.
*/
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.