1. Go to this page and download the library: Download palanik/corsslim 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/ */
palanik / corsslim example snippets
= new \Slim\Slim();
$app->add(new \CorsSlim\CorsSlim());
\Slim\Slim::registerAutoLoader();
$app = new \Slim\Slim();
= new \Slim\Slim();
$app->get('/item/:id',
\CorsSlim\CorsSlim::routeMiddleware(),
function ($name) use ($app) {
...
}
);
= new \Slim\Slim();
$corsOptions = array("origin" => "*");
$app->get('/item/:id',
\CorsSlim\CorsSlim::routeMiddleware($corsOptions),
function ($name) use ($app) {
...
}
);
= new \Slim\Slim();
$app->options('/item',
\CorsSlim\CorsSlim::routeMiddleware(),
function ($name) use ($app) {}
);
$app->post('/item',
\CorsSlim\CorsSlim::routeMiddleware(),
function ($name) use ($app) {
...
}
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.