subugoe / text-api-bundle
Provides general TextAPI implementation for Symfony 6
Installs: 193
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- symfony/asset: 6.2.*
- symfony/serializer: 6.2.*
- symfony/translation: 6.2.*
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- rector/rector: ^0.11.59
- symfony/phpunit-bridge: ^5.3.4
This package is auto-updated.
Last update: 2024-12-13 13:21:19 UTC
README
Symfony Framework Bundle that generates TextAPI resources
Requirements
- PHP >= 8.1
- Composer
- Symfony >= 6.2
Installation
-
To add this bundle to your Symfony application please run:
composer require @subugoe/text-api-bundle
-
This bundle requires your custom Translator that communicates with your database layer to retrieve the actual data from your solution. The translator class needs to implement the
TranslatorInterface
. -
Add this configuration to your
/config/services.yaml
:myapp.translator: class: App\Service\[YOUR_CUSTOM_TRANSLATOR_CLASS] subugoe_text_api.text_api_service: class: Subugoe\TextApiBundle\Service\TextApiService calls: - setTranslator: ['@myapp.translator']
-
Create a controller that fits your needs and call methods from the
TextApiService
. Creating routes is not in the scope of this bundle so you still keep the full control of your Responses. There is an example controller under/examples
.