lifestyle / sulu-template-api-bundle
1.2.0
2019-04-11 09:44 UTC
Requires
- php: ^7.2
- jackalope/jackalope-doctrine-dbal: ^1.3
- jackalope/jackalope-jackrabbit: ^1.3
- sulu/sulu: ^1.6
- symfony/config: ^3.4|^4.1
- symfony/dependency-injection: ^3.4|^4.1
- symfony/http-kernel: ^3.4|^4.1
Requires (Dev)
- fzaninotto/faker: ^1.8
- phpunit/phpunit: ^8.0
- symfony/phpunit-bridge: ^3.4|^4.1
- symfony/var-dumper: ^3.4|^4.1
This package is not auto-updated.
Last update: 2020-07-30 16:28:06 UTC
README
... for the Sulu CMS.
Requirements
- Sulu Version 1.6
- PHP7.2
Installation
composer require lifestyle/sulu-template-api-bundle
1. add to abstract kernel app/AbstractKernel.php
abstract class AbstractKernel extends SuluKernel
{
public function registerBundles()
{
$bundles = [
...
new LifeStyle\Sulu\TemplateApiBundle\LifeStyleSuluTemplateApiBundle(),
...
];
...
}
...
}
2. add route app/config/website/routing.yml
life_style_api_route:
resource: "@LifeStyleSuluTemplateApiBundle/Resources/config/routing.yml"
prefix: /
3. add the configuration to your app/config/config.yml
life_style_sulu_template_api:
available_languages: ['de', 'en']
header_template: '@LifestyleSuluTemplate/templates/includes/header/header.html.twig'
footer_template: '@LifestyleSuluTemplate/templates/includes/footer/footer.html.twig'
4. example request
GET http://your-domain.tld/{locale}/api/template.json
5. example response
{
"scriptTimeSec": 0.5397,
"locale": "de",
"webspace": "sulu-webspace-name",
"headerHtml": "some html markup",
"footerHtml": "some html markup"
}
good luck and have fun!