Simple and Powerfull Template Render for Pure PHP Projects
#install
preload ready in LWFramework (https://github.com/cmgcenter/pureTemplate)
#Init in Pure PHP
function view($file, $data)
{
$viewPath = 'path/To/ViewFiles/';
$layoutPath ='path/to/layout/';
$cachePath = 'path/to/cacche/';
$template = new \CMGDevs_PureTemplate\Pure($viewPath, $layoutPath, $cachePath);
return $template->view($file, $data);
}
View Wiki(https://github.com/cmgcenter/pureTemplate/wiki)
<?php
$names = ['ana'=>45, 'cris'=>100,'robert'=>34];`
?>
<?php
{ foreach ($names as key => $value): }
<ul>
<li>{{$key}} - {{$value}}</li>
</ul>
{ endforeach }
?>
ana - 45 cris - 100 robert - 34
<?php
{ for($i=0; $i<10; $i++ )}
echo {{array[$i]}}
{endfor}
?>