https://github.com/torann/snazzy-twig
Laravel implantation of Skosh's Twig templating engine for use in a multi-tenant environment.
https://github.com/torann/snazzy-twig
Last synced: about 1 year ago
JSON representation
Laravel implantation of Skosh's Twig templating engine for use in a multi-tenant environment.
- Host: GitHub
- URL: https://github.com/torann/snazzy-twig
- Owner: Torann
- License: bsd-2-clause
- Created: 2016-02-24T00:48:58.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-04-02T19:39:03.000Z (about 8 years ago)
- Last Synced: 2025-02-15T05:43:44.373Z (over 1 year ago)
- Language: PHP
- Size: 33.2 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snazzy Twig
[](https://packagist.org/packages/torann/snazzy-twig) [](https://packagist.org/packages/torann/snazzy-twig)
Laravel implantation of [Skosh](https://github.com/Torann/skosh)'s Twig templating engine for use in a multi-tenant environment.
- [Snazzy Twig on Packagist](https://packagist.org/packages/torann/snazzy-twig)
- [Snazzy Twig on GitHub](https://github.com/torann/snazzy-twig)
## Installation
### Composer
From the command line run:
```
$ 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:
```php
app['website'];
}
}
```
> **Note:** the `getWebsite()` method is needed to get the website model to use for generating the views
Once this is done you need to register the new service provider with the application.
#### Laravel
Open up `config/app.php` and find the `providers` key.
``` php
'providers' => [
\App\Providers\TwigServiceProvider::class,
]
```
#### Lumen
For Lumen register the service provider in `bootstrap/app.php`.
``` php
$app->register(\App\Providers\TwigServiceProvider::class);
```