Skip to content

🏃· Leoch is a lightweight PHP server-side template rendering engine

License

Notifications You must be signed in to change notification settings

operfildoluiz/Leoch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sele_o_001.png

Leoch is a simple PHP server-side template rendering engine.

Demo

See demo/index.php for server-side reference and demo/templates/index.leoch.php for Leoch syntax reference.

Basic Syntax

Variables

{{$var}}

Conditional Sentences

@if[...]

@elseif[...]

@else

@endif

Iterators

@foreach($array in $var)

I'm a $var

@endforeach

Loops

@while[$i < 10]

$i++

@endwhile

Inside code blocks, there's no need to declare the variable under brackets.

Rendering

use Leoch\App\Processor\TemplateProcessor;

$template = new Template('demo');
$template->setSrc('example')
         ->fill([
                'somevar' => 'Some Var',
                'level' => 'basic',
                'somenumber' => 2,
                'somearray' => array('Red', 'Blue'),
                'somearray2' => array('Vermelho', 'Azul'),
            ])
         ->render();

About

🏃· Leoch is a lightweight PHP server-side template rendering engine

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages