PHP code example of ethan-chen-li / think-template-swoft

1. Go to this page and download the library: Download ethan-chen-li/think-template-swoft 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/ */

    

ethan-chen-li / think-template-swoft example snippets


	$dir = __DIR__."/../../";
	$config = [
		// 模板文件目录
		'view_path'   => $dir.'/resource/views/',
		// 模板编译缓存目录(可写)
		'cache_path'  => $dir.'/runtime/template/',
		// 模板文件后缀
		'view_suffix' => 'html',
	];
	$template = new Template($config);
	$data=[];
	return $template->fetch("list",$data);