https://github.com/exts/twigulence
Twig Integration Library for Opulence PHP 7.0 Framework
https://github.com/exts/twigulence
Last synced: 8 months ago
JSON representation
Twig Integration Library for Opulence PHP 7.0 Framework
- Host: GitHub
- URL: https://github.com/exts/twigulence
- Owner: exts
- License: mit
- Created: 2016-11-17T06:58:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-17T07:25:46.000Z (over 9 years ago)
- Last Synced: 2024-12-27T04:26:21.772Z (over 1 year ago)
- Language: PHP
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# About
Twigulence is a bootstrapper for the Opulence PHP 7.0 Framework.
## Installation
1. `composer require exts/twigulence --no-dev`
2. If you're running a fresh [`Opulence/Project`]() then I recommend heading into your `/PROJECT_NAME/config/http` folder and find the `bootstrappers.php` file
3. Remove the `ViewFunctionsBootstrapper::class` and `ViewBootstrapper::class` from this file and replace those with our Bootstrapper class `Twigulence\Bootstrapper::class`
4. To test add a twig file to your `resources/views` folder then in your controller call `$this->viewFactory->createView` with the file name excluding the file extension and you can use the setVars to set custom values to the view object and it'll pass that data to the twig template.
For now I hope this helps you get twig working with Opulence
## TODO
- Working on the ability to make it easy to customize the bootstrapper, for now your best bet is to extend the Bootstrapper class and overwrite the `getTwigInstance` method.