XDomain Bundle
Use this bundle to support cross-domain XHR without CORS. It
depends on the XDomain JavaScript library., (*1)
Installation
Require the caxy/xdomain-bundle package in your composer.json and update
your dependencies., (*2)
$ composer require caxy/xdomain-bundle
Register the bundle in app/AppKernel.php:, (*3)
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Caxy\Bundle\XDomainBundle\CaxyXDomainBundle(),
);
}
Import the routing definition in routing.yml:, (*4)
# app/config/routing.yml
caxy_xdomain:
resource: "@CaxyXDomainBundle/Resources/config/routing.yml"
Enable the bundle's configuration in app/config/config.yml:, (*5)
# 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., (*6)
# 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