opale / externaluribundle
Build Uri that goes outside of your symfony application
This package's canonical repository appears to be gone and the package has been frozen as a result.
1.1.3
2016-01-14 17:10 UTC
Requires
- php: >=5.4.34
- opale/externalurigenerator: ~0.4
Requires (Dev)
- phpunit/phpunit: ~4.7
This package is not auto-updated.
Last update: 2020-08-03 06:53:24 UTC
README
INSTALLATION via Composer
composer require opale/externaluribundle
CONFIGURATION
Register the bundle:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Opale\ExternalUriBundle\OpaleExternalUriBundle(), ); // ... }
Add external routes in a config file (ex.: externalRouting.yml)
xternal_url_key: scheme: "https" path: /path/{configurationId} host: %acme_example.service_url%
Add your externalRouting.yml in the config.yml
# Opale ExternalUriGenerator configuration opale_external_uri: resources: - { resource: %kernel.root_dir%/../src/Acme/MyBundle/Resources/config/externalRouting.yml }
USAGE
TWIG
{{ externalUrl(xternal_url_key, {configurationId: 103}) }} ... or {{ externalUrl(xternal_url_key) }}
Service
Call the service opale_external_uri.generator
$this->get('opale_external_uri.generator')->generate('xternal_url_key', ['configurationId' => 103]);