Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 746 Bytes

README.md

File metadata and controls

54 lines (42 loc) · 746 Bytes

tintin

The sample php Template

Installation

composer require papac/tintin

Configuration

require 'vendor/autoload.php';
$loader = new Tintin\Loader\Filesystem(__DIR__.'/views');
$tintin = new Tintin\Tinitin($loader, [
  'cache' => true,
  'cache_dir' => '/path/to/the/cache/directory',
  'extension' => 'tt',
  'expire' => ture
]);
echo $tintin->render('Hello {{name}}', ['name' => 'tintin']);
// -> Hello tintin

Usage

Condiction

@if name == 'tintin':
  {{ name }}
@elseif name == 'template':
  {{ name }}
@else:
  {{ name }}
@endif

Loop

@loop $names as $name:
  
  @if $name == 'tintin':
    ...
  @endif
  
@endloop

Inclusion

 @include('filename')