phmlabs / twigcontentbundle
include content from different sources
Installs: 6 986
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- erusev/parsedown: ~1.7
- leankoala/circuitbreaker: dev-master
- psr/cache: ^1.0
This package is auto-updated.
Last update: 2024-12-10 00:38:33 UTC
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
{% 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.
# app/config/services.yml services: phmlabs.content.retriever: class: phmLabs\TwigContentBundle\Retriever\HttpRetriever arguments: ["http://cms.example.com/#identifier#"]