Templum 介绍
Templum 是一个超轻量级的、高速的而且功能强大的 PHP 模版引擎,它重用了 PHP 本身的强大功能,提供了附加的特性以简化模版的编写。
示例模版:
[[ if (!function_exists('helperBtnAction')) { function helperBtnAction($action, $id, $icon) { echo('<a href="?action='.$action.'&id='.$id.'">'); echo('<img src="ico/'.$icon.'.png" alt="'.$icon.'" border="0" />'); echo('</a>'); }; }; ]] <h1>User list</h1> <p>Hello {{$username}}, here's a list of all the users:</p> <div id="acocunts"> @if (count($accounts) <= 0): No accounts found. @else: <table> <tr> <th> </th> <th>Username</th> <th>Full naam</th> </tr> @foreach ($accounts as $account): <tr> <td>{{helperBtnAction('account.edit', $account['id'], 'edit')}}</td> <td>{{$account['username']}}</td> <td>{{$account['realname']}}</td> </tr> @endforeach <tr> <td>{{helperBtnAction('account.add', '', 'add')}}</td> <td colspan="4"> </td> </tr> </table> @endif </div>
Templum 官网
http://templum.electricmonk.nl/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。