amara / onehydra-bundle
Bundle to integrate Amara's OneHydra library with Symfony2
Installs: 9 371
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 7
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.0,<8.0
- amara/onehydra: ~0.4.0
- doctrine/doctrine-bundle: ~1.4
- doctrine/orm: ^2.2
- symfony/framework-bundle: ~2.0|~3.0
- twig/twig: ~1.26|~2.0
Requires (Dev)
- phpunit/phpunit: ~4.8
This package is not auto-updated.
Last update: 2024-10-31 23:06:24 UTC
README
Purpose
Bundle to integrate Amara's OneHydra library with Symfony2.
It's still in development so will change often.
Installation
Use composer:
composer require amara/onehydra-bundle
Example usage
After enabling the bundle in your application, the minimal configuration for config.yml looks like:
amara_one_hydra: is_uat: true programs: your_program_id: auth_token: authtoken1
After creating the table for the entity, you'll want to run the fetch command to populate them from the OneHydra API:
app/console onehydra:fetch --all --programId=your_program_id
You will now be able to look up the OneHydra pages from your controllers etc.
// Get the entity from our system for the current request $oneHydraPage = $this->get('amara_one_hydra.page_manager')->getPageByRequest($request); if ($oneHydraPage) { // Get the PageInterface object which reflects what's on the OneHydra system $page = $oneHydraPage->getPage(); // Override what you want based on the content of page... $title = $page->getTitle(); }
Versioning
The library will be following Semantic Versioning, although we don't have a 1.0.0 release yet!