amara / onehydra-bundle
将 Amara 的 OneHydra 库与 Symfony2 集成的包
v1.0.0
2018-01-08 13:38 UTC
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-09-19 22:25:11 UTC
README
目的
用于将 Amara 的 OneHydra 库 与 Symfony2 集成的包。
它仍在开发中,因此会经常更改。
安装
使用 composer
composer require amara/onehydra-bundle
示例用法
在您的应用程序中启用此包后,config.yml 的最小配置如下所示
amara_one_hydra: is_uat: true programs: your_program_id: auth_token: authtoken1
创建实体表后,您需要运行获取命令以从 OneHydra API 中填充它们
app/console onehydra:fetch --all --programId=your_program_id
现在您将能够从控制器等中查找 OneHydra 页面。
// 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(); }
版本控制
该库将遵循语义版本控制,尽管我们还没有发布 1.0.0 版本!