Download the PHP package palanik/corsslim without Composer
On this page you can find all versions of the php package palanik/corsslim. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download palanik/corsslim
More information about palanik/corsslim
Files in palanik/corsslim
Download palanik/corsslim
More information about palanik/corsslim
Files in palanik/corsslim
Vendor palanik
Package corsslim
Short Description Cross-origin resource sharing (CORS) middleware for PHP Slim.
License MIT
Homepage https://github.com/palanik/CorsSlim
Package corsslim
Short Description Cross-origin resource sharing (CORS) middleware for PHP Slim.
License MIT
Homepage https://github.com/palanik/CorsSlim
Please rate this library. Is it a good library?
Informations about the package corsslim
CorsSlim
Cross-origin resource sharing (CORS) Middleware for PHP Slim Framework.
Usage
Composer Autoloader
Install with Composer
- Update your
composer.json
to requirepalanik/corsslim
package. - Run
composer install
to add CorsSlim your vendor folder.
Autoloading
Custom Load
Options
You can create the middleware with custom options. Pass options as associative array.
origin
=> The value to set for Access-Control-Allow-Origin response header. Default value is '*'.exposeHeaders
=> The value to set for Access-Control-Expose-Headers response header. Pass an array of strings.maxAge
=> The value to set for Access-Control-Max-Age response header.allowCredentials
=> The value to set for Access-Control-Allow-Credentials response header. Pass True/False.allowMethods
=> The value to set for Access-Control-Allow-Methods response header. Pass an array of allowed method names. Default values areGET,HEAD,PUT,POST,DELETE
.allowHeaders
=> The value to set for Access-Control-Allow-Headers response header. Pass an array of allowed headers.
Example
Whitelisted Origins
Set an array of allowed origins to origin
option. If a matching request origin found it is used.
Example
Route Middleware
New
You can now enable cors selectively for individual routes.
Use the static method routeMiddleware
to create and add cors middleware to specific routes.
Also with custom options.
For Preflighted requests, provide OPTIONS
implementation for the corresponding routes.
License
MIT
All versions of corsslim with dependencies
PHP Build Version
Package Version
Requires
slim/slim Version
>=2.4.0 <3.0
The package palanik/corsslim contains the following files
Loading the files please wait ....