PHP code example of wj008 / sdopx
1. Go to this page and download the library: Download wj008/sdopx 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/ */
wj008 / sdopx example snippets
//如果使用composer 上行可以不需要
use sdopx\Sdopx;
//开启调试模式
Sdopx::$debug = true;
$sdopx = new Sdopx();
//设置模板目录
$sdopx->setTemplateDir('./view');
//设置编译目录
$sdopx->setCompileDir('./runtime');
//注册变量
$sdopx->assign('abc', 'wj008');
//输出代码
echo $sdopx->fetch('index.tpl');