2017 © Pedro Peláez
 

library php-view

A powerful View for PHP.

image

greg-md/php-view

A powerful View for PHP.

  • Thursday, August 17, 2017
  • by greg-md
  • Repository
  • 1 Watchers
  • 1 Stars
  • 182 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 1 % Grown

The README.md

Greg PHP View

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

A powerful View for PHP., (*2)

Table of Contents:

Requirements

  • PHP Version ^7.1

Compilers

  • PHP
  • Blade

How It Works

First of all, you have to initialize a Viewer:, (*3)

$viewsDirectory = __DIR__ . '/views';

$viewer = new \Greg\View\Viewer($viewsDirectory);

Optionally, you can add a view compiler. For example a Blade Compiler specially created for the Viewer:, (*4)

// Turn it to a callable, to load only when using blade templates.
$viewer->addExtension('.blade.php', function () {
    $compiledViewsDirectory = __DIR__ . '/compiled';

    return new \Greg\View\ViewBladeCompiler($compiledViewsDirectory);
});

By default it will use Renderer as an instance of a template., (*5)

Note: If you want to use your own compiler, it has to be an instance of Compiler Strategy., (*6)

Now, you can render views where you want in your application., (*7)

Create a template file in the views directory. For example welcome.blade.php:, (*8)

<html>
    <body>
        <h1>Hello, {{ $name }}</h1>
    </body>
</html>

Use welcome template in your application:, (*9)

$content = $viewer->render('welcome', [
    'name' => 'Greg',
]);

echo $content;

Documentation

License

MIT © Grigorii Duca, (*10)

Huuuge Quote

I fear not the man who has practiced 10,000 programming languages once, but I fear the man who has practiced one programming language 10,000 times. #horrorsquad, (*11)

The Versions

17/08 2017

dev-master

9999999-dev https://github.com/greg-md/php-view

A powerful View for PHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

php blade view viewer greg-md greg-php web-artisans php-view

20/01 2017

v1.0.0

1.0.0.0 https://github.com/greg-md/php-view

Greg PHP View

  Sources   Download

MIT

The Requires

 

The Development Requires

greg php-view