2017 © Pedro Peláez
 

library slim-plates

A Pimple service provider for including php-plates into slim3

image

carbontwelve/slim-plates

A Pimple service provider for including php-plates into slim3

  • Tuesday, April 19, 2016
  • by carbontwelve
  • Repository
  • 1 Watchers
  • 0 Stars
  • 95 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

Slim3 Plates Service Provider

styleci Latest Version Software License ghit.me, (*1)

This package contains a container interop compatible service provider and a renderer for rendering php plates view scripts into a PSR-7 responsive object. It works well with version 3 of the Slim framework., (*2)

Getting started

The easiest method of getting started is to include this library via composer:, (*3)

composer require carbontwelve/slim-plates

Example usage with Slim 3

use Carbontwelve\SlimPlates\PlatesViewProvider;

include "vendor/autoload.php";

$app = new Slim\App(
    new \Slim\Container([
        'renderer' => [
            'template_path' => realpath(__DIR__.'/views'),
            'template_ext' => 'phtml'
        ]
    ])
);
$container = $app->getContainer();
$container->register(new Carbontwelve\SlimPlates\PimplePlatesViewProvider());

$app->get('/hello/{name}', function ($request, $response, $args) {
    return $this->renderer->render($response, "/hello.phtml", $args);
});

$app->run();

Example usage with any PSR-7 project

$yourData = [];
$platesRenderer = new Carbontwelve\SlimPlates\PlatesRenderer('./path/to/templates', 'phtml');
$response = $platesRenderer->render(new Response(), 'template', $yourData)

Not invented here

This project was something I put together to meet my own needs and as way of learning git. There are a couple of alternatives that you might want to investigate., (*4)

The Versions

19/04 2016

dev-master

9999999-dev

A Pimple service provider for including php-plates into slim3

  Sources   Download

MIT

The Requires

 

template slim view plates

19/04 2016

0.0.4

0.0.4.0

A Pimple service provider for including php-plates into slim3

  Sources   Download

MIT

The Requires

 

template slim view plates

19/04 2016

0.0.3

0.0.3.0

A Pimple service provider for including php-plates into slim3

  Sources   Download

MIT

The Requires

 

template slim view plates

18/02 2016

0.0.2

0.0.2.0

A Pimple service provider for including php-plates into slim3

  Sources   Download

MIT

The Requires

 

template slim view plates

18/02 2016

0.0.1

0.0.1.0

A Pimple service provider for including php-plates into slim3

  Sources   Download

MIT

The Requires

 

template slim view plates