TwigBridge icon indicating copy to clipboard operation
TwigBridge copied to clipboard

readme installation section not very clear, poss improvement

Open jdcrecur opened this issue 10 years ago • 3 comments

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.

jdcrecur avatar Oct 30 '15 16:10 jdcrecur

Sure, submit a PR :)

barryvdh avatar Nov 07 '15 20:11 barryvdh

@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.

acutting1755 avatar Jan 23 '16 00:01 acutting1755

Looks great! :+1:

jdcrecur avatar Jan 23 '16 12:01 jdcrecur