2017 © Pedro Peláez
 

cakephp-plugin cakephp-pug

Pug Template Engine Plugin for CakePHP 3

image

clthck/cakephp-pug

Pug Template Engine Plugin for CakePHP 3

  • Monday, February 27, 2017
  • by aavrug
  • Repository
  • 2 Watchers
  • 5 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Build Status Latest Stable Version Total Downloads License, (*1)

Pug Template Engine Plugin for CakePHP 3

Powered by Tale Pug for PHP., (*2)

Installation

  1. Download Composer or update composer self-update.
  2. Run php composer.phar require clthck/cakephp-pug.

If Composer is installed globally, run, (*3)

composer require clthck/cakephp-pug

Bootstrap

Add the following to your config/bootstrap.php to load the plugin., (*4)

Plugin::load('PugView');

Application Wide Usage

Place the following to your AppController.php to load the PugView class., (*5)

public function initialize()
{
    parent::initialize();

    $this->viewBuilder()
        ->className('PugView.Pug')
        ->options(['pretty' => false]);
}

What if we need to load additional helpers for our PugView instance? In this case, we can make AppView class inherit PugView class:, (*6)

...
use PugView\View\PugView;
...
class AppView extends PugView
{
    ...
    public function initialize()
    {
        $this->viewOptions([
            'pretty' => true
        ]);

        parent::initialize();

        $this->loadHelper('Form', [
            'templates' => 'form_template'
        ]);
    }
}

In Template File (.ctp.pug)

Use $view instead of $this., (*7)

= $view->Flash->render()

Usage Example of CakePHP JavaScript block

- $view->Html->scriptStart(['block' => true])
|
    $(function() {
        // Your js code goes here..
    });

- $view->Html->scriptEnd()

If you're using Sublime Text 2/3, you need to install cakephp-jade-tmbundle to make syntax highlighting work properly., (*8)

Language Syntax Reference

Please check jade.talesoft.codes for syntax reference., (*9)

The Versions

27/02 2017

dev-master

9999999-dev

Pug Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp pug view cakephp3

24/02 2017

v1.0.1

1.0.1.0

Pug Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp pug view cakephp3

23/02 2017

v1.0.0

1.0.0.0

Pug Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp pug view cakephp3

31/05 2016

v0.1.4

0.1.4.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

03/02 2016

v0.1.3

0.1.3.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

16/01 2016

v0.1.2

0.1.2.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

16/01 2016

v0.1.1

0.1.1.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

06/01 2016

v0.1.0

0.1.0.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

06/01 2016

v0.0.5

0.0.5.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

05/01 2016

v0.0.4

0.0.4.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

04/01 2016

v0.0.3

0.0.3.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

04/01 2016

v0.0.2

0.0.2.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade view cakephp3

04/01 2016

v0.0.1

0.0.1.0

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

The Requires

 

cakephp jade view cakephp3