GithubHelp home page GithubHelp logo

jbombien / cors-behavior Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iachilles/cors-behavior

0.0 1.0 0.0 284 KB

Implementing Cross-origin resource sharing support in your Yii Framework application.

PHP 100.00%

cors-behavior's Introduction

CORS Behavior

Implementing Cross-origin resource sharing support in your Yii Framework application.

####Requirements

  • Yii 1.0 or above

####Installation

  • Use Composer or just extract the release file under protected/extensions

####Configuration

Add the following code to your config file (protected/config/main.php):

	'behaviors' => array(
	        array('class' => 'application.extensions.CorsBehavior',
	            'route' => array('controller/actionA', 'controller/actionB', 'controllerC/*'),
	            'allowOrigin' => '*.domain.com'
	            ),
	    ),
  • route list of routes for CORS-requests. If you want to allow CORS-request for any routes, the value of the option must be a string that contains the "*". To allow CORS-requests for any actions of the specific controller you can also specify "controllerName/*".
  • allowOrigin the origin that is allowed to access the resource. A "*" can be specified to enable access to resource from any origin. A wildcard can be used to specify list of allowed origins, e.g. "*.yourdomain.com" (sub.yourdomain.com, yourdomain.com, sub.sub.yourdomain.com will be allowed origins in that case)

cors-behavior's People

Contributors

iachilles avatar svechnikov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.