2017 © Pedro Peláez
 

library larpug

Adds the power of Pug to Laravel

image

acidjazz/larpug

Adds the power of Pug to Laravel

  • Tuesday, September 26, 2017
  • by acidjazz
  • Repository
  • 4 Watchers
  • 37 Stars
  • 490 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 3 Open issues
  • 4 Versions
  • 1 % Grown

The README.md

, (*1)

Allows you to use native Pug (formerly Jade) seamlessly in Laravel 5 and Lumen, (*2)

Total Downloads Latest Stable Version License Build Status Dependency Status codecov, (*3)

Join the chat at https://gitter.im/acidjazz/larpug, (*4)

Requirements

Installation

Require this package with Composer, (*5)

composer require acidjazz/larpug

Install the needed node modules to run pug, (*6)

npm i --prefix vendor/acidjazz/larpug/node/

Laravel

Once Composer has installed or updated your packages you need to register larpug with Laravel itself. Open up config/app.php and find the providers key, towards the end of the file, and add 'larpug\LarpugServiceProvider', to the end:, (*7)

'providers' => [
  ...
    Larpug\ServiceProvider::class,
],

Lumen

For usage with Lumen, add the service provider in bootstrap/app.php., (*8)

$app->register(Larpug\ServiceProvider::class);

Usage

Using this is exactly the same way as using Blade templates, place your pug files in your views folder (usually in resources/views) and render them using view(), (*9)

namespace App\Controllers;

class Pages extends Controller
{
  public function index()
  {
    return view('pages.index', ['name' => 'kevin', 'title' => 'test title']);
  }

}

This will look for resources/views/pages/index.pug, (*10)

doctype
html(lang='en')
  head
    title Title: #{self.title}
  body
    .page.index 
      .name=self.name

Which will render something like, (*11)

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Title: test title </title>
  </head>
  <body>
    <div class="page index">
      <div class="name">Kevin</div>
    </div>
  </body>
</html>';

The Versions

26/09 2017

dev-master

9999999-dev

Adds the power of Pug to Laravel

  Sources   Download

MIT

The Requires

  • php >=5.6.25

 

The Development Requires

by Kevin Olson

laravel lumen jade pug

07/02 2017

v0.2.2

0.2.2.0

Adds the power of Pug to Laravel

  Sources   Download

MIT

The Requires

  • php >=5.6.25

 

The Development Requires

by Kevin Olson

laravel lumen jade pug

16/11 2016

v0.2.1

0.2.1.0

Adds the power of Pug to Laravel

  Sources   Download

MIT

The Requires

  • php >=5.6.25

 

The Development Requires

by Kevin Olson

laravel lumen jade pug

05/09 2016

v0.2.0

0.2.0.0

Adds the power of Pug to Laravel

  Sources   Download

MIT

The Requires

  • php >=5.6.25

 

The Development Requires

by Kevin Olson

laravel lumen jade pug