dev-master
9999999-dev https://smalldb.org/template-sloth/Slot-based template extension
Apache-2.0
The Requires
- php >=5.6
- symfony/http-foundation ^3.2
- twig/twig *
The Development Requires
by Josef Kufner
Slot-based template extension
Slot-based template extension., (*1)
See https://smalldb.org/template-sloth/, (*2)
..., (*3)
Using Composer:, (*4)
composer require smalldb/template-sloth
Symfony's config.yml
— add sloth
service, it will register into Twig
automatically:, (*5)
```.yaml services: sloth: class: Smalldb\TemplateSloth\Sloth arguments: [ '@twig' ], (*6)
Troubleshooting --------------- > Error: Unexpected "slot" tag (expecting closing tag for the "…" tag defined near line …) in … This means the Sloth did not install the Twig extension. Is your dependency injection container configured properly? Usage ----- ```.php $sloth = $this->get('sloth'); $sloth->setLayout('layout.html.twig', [ 'user' => 'Alice']); $sloth->slot('content')->add(10, 'template.html.twig', [ 'foo' => 'bar' ]; $sloth->slot('content')->add(20, 'template.html.twig', [ 'foo' => 'foo' ]; return $sloth->response();
.twig
{% if 'content' is empty_slot %}
No content available.
{% else %}
{% slot 'content' %}
{% endif %}
, (*7)
See https://smalldb.org/doc/template-sloth/master/, (*8)
The most of the code is published under Apache 2.0 license. See LICENSE file for details., (*9)
Project's primary repository is hosted at https://git.frozen-doe.net/smalldb/template-sloth, feel free to submit issues there or create merge requests., (*10)
Slot-based template extension
Apache-2.0