PHP code example of adhocore / plastic

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

    

adhocore / plastic example snippets


use Ahc\Plastic\Client;

# Instantiate:
$client = new Ahc\Plastic\Client(null, true);

# Usage convention:
$client->{$httpMethod}->$segment1->$segment2->$method($data, $query);

# For numeric segment or method, prepend with `_`!
# (this is because PHP doesnt allow numeric method or props without some hack)

# Example:
$client->post->articles->article->_1(['json_key' => 'value'], ['query' => 'param']);