2017 © Pedro Peláez
 

library smarty-slim-view

View that allows you to use Smarty with Slim

image

austp/smarty-slim-view

View that allows you to use Smarty with Slim

  • Sunday, October 25, 2015
  • by AustP
  • Repository
  • 1 Watchers
  • 0 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

smarty-slim-view

View that allows you to use Smarty with Slim, (*1)

Installation

composer require austp/smarty-slim-view

As a note, you will still need to require Slim and Smarty yourself. This view just integrates the two., (*2)

Configuration

You need to define your template, compile, and cache directories upon initializing the View. You can also optionally define a plugin directory., (*3)

public function __construct($template_dir, $compile_dir, $cache_dir, $plugin_dir = '');

Use

<?php

require('vendor/autoload.php');

$app = new \Slim\Slim([
    'view' => new \Slim\View\Smarty(
        __DIR__ . '/templates',
        __DIR__ . '/templates/compile',
        __DIR__ . '/templates/cache
    );
]);

$app->get('/', function () use ($app) {
    $view = $app->view();
    $view->assign('title', 'Hello World');

    $view->display('base.tpl');
});

$app->run();

The Versions

25/10 2015

dev-master

9999999-dev https://github.com/AustP/smarty-slim-view

View that allows you to use Smarty with Slim

  Sources   Download

MIT

The Requires

 

by Aust

smarty slim view

25/10 2015

1.0.0

1.0.0.0 https://github.com/AustP/smarty-slim-view

View that allows you to use Smarty with Slim

  Sources   Download

MIT

The Requires

 

by Aust

smarty slim view