2017 © Pedro Peláez
 

library laravel-array-view

Laravel Array View

image

php-soft/laravel-array-view

Laravel Array View

  • Thursday, February 25, 2016
  • by huytbt
  • Repository
  • 6 Watchers
  • 3 Stars
  • 8,081 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 2 % Grown

The README.md

Laravel Array View

Build Status, (*1)

An array view engine for Laravel PHP Framework., (*2)

Version Compatibility

ArrayView Laravel
1.0.x 5.1.x
1.1.x 5.1.x
1.1.4 5.*

Installation

$ composer require php-soft/laravel-array-view

Once this has finished, you will need to add the service provider to the providers array in your app.php config as follows:, (*3)

'providers' => [
    // ...
    PhpSoft\ArrayView\Providers\ArrayViewServiceProvider::class,
]

Next, also in the app.php config file, under the aliases array, you may want to add facades., (*4)

'aliases' => [
    // ...
    'ArrayView' => PhpSoft\ArrayView\Facades\ArrayView::class,
]

Usage

Code in controller (Example routes.php), (*5)

<?php

Route::get('/articles/{id}', function ($id) {

    $article = Article::find($id);
    return response()->json(arrayView('article', [ 'article' => $article ]));
});

views/article.array.php, (*6)

<?php

$this->set('title', $article->title);
$this->set('author', function ($section) use ($article) {

    $section->set('name', $article->author->name);
});

This template generates the following object:, (*7)

[
    'title' => 'Example Title',
    'author' => [
        'name' => 'John Doe'
    ]
]

Functions

Reference to https://github.com/huytbt/php-array-view#functions, (*8)

The Versions

25/02 2016

dev-master

9999999-dev

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

25/02 2016

v1.1.4

1.1.4.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

26/08 2015

v1.1.3

1.1.3.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

26/08 2015

v1.1.2

1.1.2.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

25/08 2015

v1.1.1

1.1.1.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

14/08 2015

v1.1.0

1.1.0.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

18/07 2015

v1.0.2

1.0.2.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

17/07 2015

v1.0.1

1.0.1.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view

16/07 2015

v1.0.0

1.0.0.0

Laravel Array View

  Sources   Download

MIT

The Requires

 

The Development Requires

by Huy Ta

laravel helper array view