PHP code example of e-artspace / resourceful

1. Go to this page and download the library: Download e-artspace/resourceful 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/ */

    

e-artspace / resourceful example snippets


$app = new Silex\Application;
$app->register(new Resourceful\ServiceProvider,array(
	'data.dir' => __DIR__ . '/../data'
));

$app->mount("/", new Resourceful\IndexControllerProvider);
$app->mount("/schema", new Resourceful\SchemaControllerProvider);

//here add your restful resources
$app->mount("/foo", new Resourceful\CRUDControllerProvider('foo'));

$app->run();

$app->mount("/bar", new Resourceful\CRUDControllerProvider("bar");

$app["foo.uniqid"] = $app->protect(function ($data) {
    return md5(serialize($data));
});

> php -S localhost:8080 front.php