2017 © Pedro Peláez
 

library slim-view

Slim Framework 3 view helper built on top of the FigDice templating component

image

figdice/slim-view

Slim Framework 3 view helper built on top of the FigDice templating component

  • Thursday, December 3, 2015
  • by figdice
  • Repository
  • 1 Watchers
  • 0 Stars
  • 135 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

figdice-slim

Slim Framework 3 Delegate for FigDice View, (*1)

Container (DI) View component for the Slim Framework 3, that wires FigDice Templating library into Slim., (*2)

Read Slim Views Documentation for more details., (*3)

Installation

In composer.json:, (*4)

"require": {
  "figdice/slim-view": "*"
}

Usage

1. Register FigDice SlimView component in Slim container

// Create container
$container = new \Slim\Container;

// Register component on container
$container['view'] = function ($c) {
  $slimview = new \figdice\slim\SlimView('path/to/templates');

  // Optionally configure FigDice View settings
  // (cache directory, dictionaries, feed & function factories, etc.)
  $slimview->getView()->setTempPath('path/to/cache');
  $slimview->getView()->registerFeedFactory( new MyFeedFactory(...) );
  // ...

  return $slimview;
};

2. Render FigDice templates in Slim routes

// Create app
$app = new \Slim\App($container);

// Render FigDice template in route
$app->get('/hello/{name}', function ($request, $response, $args) {
    return $this->view->render($response, 'profile.html', [
        'name' => $args['name']
    ]);
});

// Run app
$app->run();

The Versions

03/12 2015

dev-master

9999999-dev http://figdice.org

Slim Framework 3 view helper built on top of the FigDice templating component

  Sources   Download

MIT

The Requires

 

framework template slim view figdice

12/10 2015

3.0.x-dev

3.0.9999999.9999999-dev http://figdice.org

Slim Framework 3 view helper built on top of the FigDice templating component

  Sources   Download

MIT

The Requires

 

framework template slim view figdice