1. Go to this page and download the library: Download komodohq/siesta 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/ */
komodohq / siesta example snippets
public static function populate($item)
{
$reflect = new ReflectionClass($class);
return $reflect->newInstanceArgs($item);
}
php
class User {
use Siesta\Siesta;
private static $siestaConfig = [
"url" => "http://localhost:9999",
"endpoint" => "users"
];
// constructor takes assoc array of properties
function __construct($data) {
$this->_id = $data['id'];
$this->name = $data['name'];
}
}
$users = User::find();