PHP code example of causal / simple_api

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

    

causal / simple_api example snippets


$EM_CONF[$_EXTKEY] = [
    // snip
    'constraints' => [
        'depends' => [
            'php' => '5.5.0-7.1.99',
            'typo3' => '7.6.0-8.99.99',
        ],
        'conflicts' => [],
        'suggests' => [
            'simple_api' => '',
        ],
    ],
];

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['simple_api']['apiHandlers'][] = [
    'route' => '/some-route',
    'class' => \VENDOR\YourExt\Api\YourClass::class,
];

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['simple_api']['apiPatternHandlers'][] = [
    'route' => '/members/\d+/history',
    'class' => \VENDOR\YourExt\Api\YourClass::class,
];

   RewriteRule ^api/(.*)$ /index.php?eID=simple_api&route=$1 [QSA,L]