Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phmlabs/twigcontentbundle
https://github.com/phmlabs/twigcontentbundle
bundle symfony twig wordpress
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/phmlabs/twigcontentbundle
- Owner: phmLabs
- Created: 2016-05-17T04:41:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-08-09T13:38:09.000Z (over 5 years ago)
- Last Synced: 2024-10-12T23:05:04.160Z (about 1 month ago)
- Topics: bundle, symfony, twig, wordpress
- Language: PHP
- Size: 23.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
#TwigContentBundle
This twig tag extension helps to provide content snippets from different sources. It also provides a fallback case if no content retriever is defined.
## Usage
```twig
{% content status_no_projects_yet %}
This is the default text for the content snippet with the identifier status_no_projects_yet.
It will appear if the configured retriever does not return content.
{% endcontent %}
```## Content Retriever
### Null Retriever
The null retriever returns the text defined inside the content block. The null retriever is the standard retriever and must not be configured.### Http Retriever
The http retriever can be used to fetch content via an http request.```yml
# app/config/services.ymlservices:
phmlabs.content.retriever:
class: phmLabs\TwigContentBundle\Retriever\HttpRetriever
arguments: ["http://cms.example.com/#identifier#"]
```