2017 © Pedro Peláez
 

symfony-bundle template-sloth

Slot-based template extension

image

smalldb/template-sloth

Slot-based template extension

  • Monday, July 24, 2017
  • by jkufner
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Template Sloth

Slot-based template extension., (*1)

See https://smalldb.org/template-sloth/, (*2)

..., (*3)

Installation

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)

Documentation

See https://smalldb.org/doc/template-sloth/master/, (*8)

License

The most of the code is published under Apache 2.0 license. See LICENSE file for details., (*9)

Contribution guidelines

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)

The Versions

24/07 2017

dev-master

9999999-dev https://smalldb.org/template-sloth/

Slot-based template extension

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

by Josef Kufner