medz/cors
package supported Slim framework 3.
See 👉Configure example.
Slim frameowk supported class name is Medz\Cors\Slim\Cors
, Simple use:
$app = new Slim\App();
$app->add(new Medz\Cors\Slim\Cors);
💡Slim framework middleware using see https://www.slimframework.com/docs/v3/concepts/middleware.html
$settings = [
// The configure see https://github.com/medz/cors#configure
];
$app = new Slim\App();
$app->add(new Medz\Cors\Slim\Cors($settings));
$cors = // Todo, The instance is \Medz\Cors\CorsInterface::class
$app = new Slim\App();
$app->add(new Medz\Cors\Slim\Cors($cors));
- payload: This is Medz\Cors\CorsInterface or array or null
- append: The type is boolean, If using
true
, All request set CORS to response hraders.
E.g:
$settings = [
// The configure see https://github.com/medz/cors#configure
];
$appendAllResponse = true;
$app = new Slim\App();
$app->add(new Medz\Cors\Slim\Cors($settings, $appendAllResponse));