diff --git a/README.md b/README.md index 3399aba74c204180d45c20c27cbd5c2d44edd1b3..0227c43afd67cfb86f27cff968f37d07a9532e50 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Relay Template Bundle +# Relay Example Bundle -This Symfony bundle can be used as a template for creating new bundles for the +This Symfony bundle can be used as an example for creating new bundles for the DBP Relay project. When including this bundle into your API server it will gain the following @@ -12,17 +12,17 @@ features: ## TL;DR -The quickest way to make use of this template bundle is to feed your desired names +The quickest way to make use of this example bundle is to feed your desired names to one command and generate a ready-to-use bundle with the correct naming. See [Generate DBP Symfony bundle](https://dbp-demo.tugraz.at/dev-guide/relay/naming/#generate-dbp-symfony-bundle) for more information. -## Using the Bundle as a Template +## Using the Bundle as an example * Copy the repo contents * Adjust the package name in `composer.json`, in this example we'll pretend you named your bundle `dbp/relay-your-bundle` * Invent a new PHP namespace and adjust it in all PHP files -* Rename `src/DbpRelayTemplateBundle` and `DependencyInjection/DbpRelayTemplateExtension` to match the new project name +* Rename `src/DbpRelayExampleBundle` and `DependencyInjection/DbpRelayExampleExtension` to match the new project name ## Integration into the API Server @@ -61,16 +61,16 @@ DBP\API\CoreBundle\DbpCoreBundle::class => ['all' => true], The bundle has a `example_config` configuration value that you can specify in your app, either by hard-coding it, or by referencing an environment variable. -For this create `config/packages/dbp_relay_template.yaml` in the app with the following +For this create `config/packages/dbp_relay_example.yaml` in the app with the following content: ```yaml -dbp_relay_template: +dbp_relay_example: example_config: 42 # example_config: '%env(EXAMPLE_CONFIG)%' ``` -The value gets read in `DbpRelayTemplateExtension` (your extension will be named differently) +The value gets read in `DbpRelayExampleExtension` (your extension will be named differently) and passed when creating the `MyCustomService` service. For more info on bundle configuration see [Symfony bundles configuration](https://symfony.com/doc/current/bundles/configuration.html). diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 4e38e5aead809d980374a54d4fc7aa5fbb187fac..86353cb001593a56f9f9fead26e9260e43e1cc51 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -11,7 +11,7 @@ class Configuration implements ConfigurationInterface { public function getConfigTreeBuilder(): TreeBuilder { - $treeBuilder = new TreeBuilder('dbp_relay_template'); + $treeBuilder = new TreeBuilder('dbp_relay_example'); $treeBuilder->getRootNode() ->children() diff --git a/tests/Kernel.php b/tests/Kernel.php index a2aa1c745db071859e007c5d4370b4ab632abe32..d3ee50e2f82c993d372ce44589b32b84325aaa1a 100644 --- a/tests/Kernel.php +++ b/tests/Kernel.php @@ -47,7 +47,7 @@ class Kernel extends BaseKernel 'secret' => '', ]); - $container->extension('dbp_relay_template', [ + $container->extension('dbp_relay_example', [ 'example_config' => 'test-42', ]); }