2017 © Pedro Peláez
 

cakephp-plugin blade-view

Blade template engine for CakePHP3

image

dowilcox/blade-view

Blade template engine for CakePHP3

  • Saturday, April 9, 2016
  • by dowilcox
  • Repository
  • 4 Watchers
  • 7 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

BladeView

Laravel's Blade template engine in CakePHP 3., (*1)

Install

Composer:, (*2)

    [
        "require": {
            "dowilcox/blade-view": "0.2.*"
        }
    ]

In your bootstrap.php:, (*3)

Plugin::load('BladeView', ['bootstrap' => false]);

In your controller:, (*4)

public $viewClass = '\Dowilcox\BladeView\View\BladeView';

Now change all the template files in src/Template from .ctp to .blade.php, (*5)

Usage

See Laravel's documenation for Blade: http://laravel.com/docs/4.2/templates., (*6)

CakePHP view functions and helpers work a bit different., (*7)

Variables

Before:, (*8)

<?php echo h($variable); ?>

After:, (*9)

{{{ $variable }}}

View functions:

Before:, (*10)

<?php echo $this->fetch(); ?>

After:, (*11)

@fetch()

Helpers (if loaded in a controller):

Before:, (*12)

<?php echo $this->Html->css(); ?>

After:, (*13)

@html->css()

More Examples

{{-- src/Template/Common/view.blade.php --}}


@fetch('title')

@fetch('content')

Related actions

    @fetch('sidebar')
{{-- src/Template/Posts/view.blade.php --}}
@extend('/Common/view')

@assign('title', $post)

@start('sidebar')
<li>
    @html->link('edit', [
        'action' => 'edit',
        $post['Post']['id']
    ])
</li>
@end()

{{-- The remaining content will be available as the 'content' block --}}
{{-- In the parent view. --}}
{{{ $post['Post']['body'] }}}

The Versions

09/04 2016

dev-master

9999999-dev https://github.com/dowilcox/BladeView

Blade template engine for CakePHP3

  Sources   Download

MIT

The Requires

 

cakephp blade view cakephp3

01/10 2014

v0.2.1

0.2.1.0 https://github.com/dowilcox/BladeView

Blade template engine for CakePHP3

  Sources   Download

MIT

The Requires

 

cakephp blade view cakephp3

29/09 2014

v0.2.0

0.2.0.0 https://github.com/dowilcox/BladeView

Blade template engine for CakePHP3

  Sources   Download

MIT

The Requires

 

cakephp blade view cakephp3

29/09 2014

v0.1.0

0.1.0.0 https://github.com/dowilcox/BladeView

Blade template engine for CakePHP3

  Sources   Download

MIT

The Requires

 

cakephp blade view cakephp3