Skip to content

daohassane/tintin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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')

About

The sample php Template

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages