TwigBridge
TwigBridge copied to clipboard
readme installation section not very clear, poss improvement
I am using laravel for the very first time this afternoon.. as soon as i got the views i quickly wanted out and wanted to use twig.. google brought me straight here but then the readme in the git repo left me scratching my head for a little while.
A super clear beginners intro would be awesome to have:
1a - add the new dependency to the composer.json
"require": {
...
"rcrowe/twigbridge" : ">=0.8"
...
},
1b - run composer update
composer update --lock
2 - add twig to the providers array in config/app.php
'providers' => [
...
'TwigBridge\ServiceProvider',
],
3 - Add to the aliases array in config/app.php
'aliases' => [
....
'Twig' => 'TwigBridge\Facade\Twig',
],
4 - Use the laravel artisan cli tool to add the new twig config file
php artisan vendor:publish --provider="TwigBridge\ServiceProvider"
5 - How to use in a simple route with a twig template file The route:
//app/Http/routes.php
Route::get('/', function () {
return View::make('hello');
});
Create the twig file at the following location:
resources/views/hello.twig
That is the uber basics on getting twig running in you laravel installation.
Sure, submit a PR :)
@johnc1984 I adjusted the readme.md file based off your suggestions. Could you take a look at that and make sure it meets the needs you expressed. @barryvdh if there are any issues with this please let me know this is my first time doing a pull request on github.
Looks great! :+1: