PHPTAL
第 3 版(2009-09-18 14:00:15 · akkun_choi)を表示しています。 最新版に戻る
HTMLの属性で処理を記述できるPHPのテンプレートエンジン。
Zope Page Templatesを実装したものらしい。使ってみたい。
ベンチマーク
http://d.hatena.ne.jp/tanakahisateru/20081024/1224850023
Smartyより若干遅いぐらい
レイアウト機能
こりゃすごいな。
http://lists.motion-twin.com/pipermail/phptal/2007-June/000791.html
You can have ONE design.html which contains you base design in one macro :
<html metal:define-macro="main">
<head>
<title>Hello</title>
</head>
<body>
<div id="header">
<h1>Hello</h1>
</div>
<div id="menu">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/about">About</a></li>
...
</ul>
</div>
<div id="content">
<metal:block define-slot="content"/>
</div>
<div id="footer">
Copyright (c) ...
</div>
</body>
</html>
And then you just call your design from each template :
<html metal:use-macro="design.html/main">
<body metal:fill-slot="content" tal:ignore-tag="">
<h1>My content</h1>
foo bar baz
</body>
</html>