1. Go to this page and download the library: Download baagee/php-template library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
baagee / php-template example snippets
interface ViewInterface
{
// 渲染,返回解析后的html模板
public static function render(string $source, array $data = []);
// 渲染并输出 没有返回
public static function display(string $source, array $data = []);
}
html
<b>跑车简介:</b>{{$item['aaa']['description']}}<br>