Skip to content
Simple PHP Template engine
PHP HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
templates
LICENSE
MunTemplate.class.php
README.md
index.php

README.md

MunTemplate

Simple PHP Template engine

Made by munsiwoo

  • How to use?
<?php
include 'MunTemplate.class.php'; # first include class

$MunTemplate = new MunTemplate('./templates/'); # set path

$my_name = 'munsiwoo';
$MunTemplate->render_template('main.html', ['name'=>$my_name]);

Statements

  • How to use for statement?
@mun for($num=0; $num<10; $num++)
	num is @var($num+1)<br>
@endfor
  • How to use if statement?
@mun if(true)
	<h1>TRUE</h1>
@mun else
	<h1>FALSE</h1>
@endif
  • How to use variable?
<p>your name is @var($name)</p>
  • How to pass variable?
<?php
/* index.php */
render_template('main.html', ['var1'=>'1', 'var2'=>array(1,2,3)]);
<!-- main.html -->
var1 is @var($var1)<br>
var2 is @var($var2)
You can’t perform that action at this time.