2017 © Pedro Peláez
 

library snazzy-twig

Render user templates using the power of Twig

image

torann/snazzy-twig

Render user templates using the power of Twig

  • Monday, April 2, 2018
  • by torann
  • Repository
  • 2 Watchers
  • 0 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 10 Versions
  • 21 % Grown

The README.md

Snazzy Twig

Latest Stable Version Total Downloads, (*1)

Laravel implantation of Skosh's Twig templating engine for use in a multi-tenant environment., (*2)

Installation

Composer

From the command line run:, (*3)

$ composer require torann/snazzy-twig

The Service Provider

You will need to extend the built in service provider so that you can add your custom widgets and get the website instance. To do this create a service provider named TwigServiceProvider in the \app\Providers directory and extend the Snazzy Twig provider like below:, (*4)

<?php

namespace App\Providers;

use Torann\SnazzyTwig\TwigServiceProvider as ServiceProvider;

class TwigServiceProvider extends ServiceProvider
{
    /**
     * Twig view widgets.
     *
     * @var array
     */
    protected $widgets = [
        //
    ];

    /**
     * Get the current website.
     *
     * @return \Torann\SnazzyTwig\Contracts\WebsiteInterface
     */
    protected function getWebsite()
    {
        return $this->app['website'];
    }
}

Note: the getWebsite() method is needed to get the website model to use for generating the views, (*5)

Once this is done you need to register the new service provider with the application., (*6)

Laravel

Open up config/app.php and find the providers key., (*7)

``` php 'providers' => [, (*8)

\App\Providers\TwigServiceProvider::class,

], (*9)


#### Lumen For Lumen register the service provider in `bootstrap/app.php`. ``` php $app->register(\App\Providers\TwigServiceProvider::class);

The Versions

02/04 2018

dev-master

9999999-dev

Render user templates using the power of Twig

  Sources   Download

BSD-2-Clause BSD 2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

02/04 2018

0.1.4

0.1.4.0

Render user templates using the power of Twig

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

02/04 2018

0.1.3

0.1.3.0

Render user templates using the power of Twig

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

13/03 2018

0.1.2

0.1.2.0

Render user templates using the power of Twig

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

09/02 2018

0.1.1

0.1.1.0

Render user templates using the power of Twig

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

04/01 2018

0.1.0

0.1.0.0

Render user templates using the power of Twig

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

05/12 2016

0.0.4

0.0.4.0

Render user templates using the power of Twig

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

30/11 2016

0.0.3

0.0.3.0

Render user templates using the power of Twig

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

04/03 2016

0.0.2

0.0.2.0

Render user templates using the power of Twig

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants

24/02 2016

0.0.1

0.0.1.0

Render user templates using the power of Twig

  Sources   Download

BSD 2-Clause

The Requires

 

The Development Requires

twig templates multi-tenancy tenants