2017 © Pedro Peláez
 

cakephp-plugin cakephp-jade

Pug Template Engine Plugin for CakePHP 3

image

clthck/cakephp-jade

Pug Template Engine Plugin for CakePHP 3

  • Thursday, February 23, 2017
  • by aavrug
  • Repository
  • 3 Watchers
  • 0 Stars
  • 7,495 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 12 Versions
  • 11 % Grown

The README.md

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

Jade Template Engine Plugin for CakePHP 3

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

Installation

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

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

composer require clthck/cakephp-jade

Bootstrap

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

Plugin::load('JadeView');

Application Wide Usage

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

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

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

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

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

        parent::initialize();

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

In Template File (.ctp.jade)

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.io for syntax reference., (*9)

The Versions

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

dev-master

9999999-dev

Jade Template Engine Plugin for CakePHP 3

  Sources   Download

MIT

The Requires

 

cakephp jade 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