/SlmCors

A CORS (Cross-Origin Resource Sharing) helper module for Zend Framework 2

Primary LanguagePHPOtherNOASSERTION

SlmMail

Build Status Latest Stable Version

Created by Jurian Sluiman

Introduction

SlmCors is a module that provides Cross-Origin Resource Sharing (CORS) inside Zend Framework 2 applications.

Requirements

Installation

Add "slm/cors" to your composer.json file and update your dependencies. Enable SlmCors in your application.config.php.

If you do not have a composer.json file in the root of your project, copy the contents below and put that into a file called composer.json and save it in the root of your project:

{
    "require": {
        "slm/cors": "@dev"
    }
}

Then execute the following commands in a CLI:

curl -s http://getcomposer.org/installer | php
php composer.phar install

Now you should have a vendor directory, including a slm/cors. In your bootstrap code, make sure you include the vendor/autoload.php file to properly load the SlmCors module.

Usage

Once SlmCors is enabled, it provides by-default CORS headers in all requests and responses.