library twigcontentbundle
include content from different sources
phmlabs/twigcontentbundle
include content from different sources
- Monday, July 16, 2018
- by phmLabs
- Repository
- 1 Watchers
- 1 Stars
- 91 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 1 % Grown
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., (*1)
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., (*2)
Http Retriever
The http retriever can be used to fetch content via an http request., (*3)
# app/config/services.yml
services:
phmlabs.content.retriever:
class: phmLabs\TwigContentBundle\Retriever\HttpRetriever
arguments: ["http://cms.example.com/#identifier#"]
dev-master
9999999-dev
include content from different sources
Sources
Download
The Requires