caxy/xdomain-bundle

XDomain for cross domain request support in IE9

1.0.2 2016-07-12 01:47 UTC

This package is auto-updated.

Last update: 2024-04-22 06:27:54 UTC


README

Use this bundle to support cross-domain XHR without CORS. It depends on the XDomain JavaScript library.

Installation

Require the caxy/xdomain-bundle package in your composer.json and update your dependencies.

$ composer require caxy/xdomain-bundle

Register the bundle in app/AppKernel.php:

// app/AppKernel.php
public function registerBundles()
{
    return array(
        // ...
        new Caxy\Bundle\XDomainBundle\CaxyXDomainBundle(),
    );
}

Import the routing definition in routing.yml:

# app/config/routing.yml
caxy_xdomain:
    resource: "@CaxyXDomainBundle/Resources/config/routing.yml"

Enable the bundle's configuration in app/config/config.yml:

# app/config/config.yml
caxy_xdomain:
    allow_from: http://example.com

Add an asset named xdomain_js to your Assetic bundle configuration with the URL of the XDomain script. The URL in this example comes from the XDomain documentation.

# app/config/config.yml
framework:
    assets:
        packages:
            xdomain:
                version: 0.7.5
                version_format: %%2$s/dist/%%1$s
                base_urls:
                    - //cdn.rawgit.com/jpillora/xdomain