funddy / jscrossdomain-bundle
Js cross domain bundle for Symfony2
Installs: 228
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.3
- symfony/framework-bundle: >=2.0
Requires (Dev)
- mockery/mockery: 0.7.2
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2025-02-10 16:02:11 UTC
README
This bundle enables you to make cross domain requests with Javascript.
Setup and Configuration
Add the following to your composer.json file:
{ "require": { "funddy/jscrossdomain-bundle": "1.0.*" } }
Update the vendor libraries:
curl -s http://getcomposer.org/installer | php
php composer.phar install
Register the Bundle FunddyJsCrossDomainBundle in app/AppKernel.php.
// ... public function registerBundles() { $bundles = array( // ... new Funddy\Bundle\JsCrossDomainBundle\FunddyJsCrossDomainBundle() // ... ); // ... }
Include cross domain route at app/config/routing.yml
cross_domain: resource: "@FunddyJsCrossDomainBundle/Resources/config/routing.yml"
Usage
Configure allowed cross domain URLs at app/config/config.yml
funddy_js_cross_domain: allowed: - http://graph.facebook.com/?ids=
Make cross domain request
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script> <script src="{{ asset('bundles/funddyjscrossdomain/js/lib/funddycrossdomain.js') }}"></script> <script> var cd = new FUNDDY.CrossDomain($); cd.get("http://graph.facebook.com/?ids=https://funddy.com").done(function(response) { console.log(response); }); </script>