PHP DOM Template
PHP DOM Template 是一个快速的 PHP 模板引擎,下面是一个 Hello World 的例子:
<?php
// Start the output buffer
ob_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PHP Dom Template (PDT) Library - example01.html</title>
<link rel="stylesheet" type="text/css" href="../css/stylesheet.css" />
</head>
<body>
<p><a href="../example01.php">Back To Example 1</a></p>
<div id="content">
<h1>Hello World</h1>
<p var="helloWorld">Default Text</p>
<p> </p>
<p class="copyright"><a href="http://www.domtemplate.com">Copyright 2008 PHP DOM Template</a></p>
</div>
<p><a href="../example01.php">Back To Example 1</a></p>
</body>
</html>
<?php
// include the Template lib
include_once dirname(__FILE__) . '/../Template.php';
// Create a template from the html in the buffer
$buff = ob_get_clean();
$template = Dk_Dom_Template::loadXml($buff);
$template->replaceText('helloWorld', 'This is the `Hello World` Dynamic text.');
echo $template->getDocument()->saveXML();
?>
评论
TPTtiny php template
关于TPTTPT是php实现的用于模板解析小工具,全部实现仅仅60行代码。配置DIR_COMPILED和DIR_TEMPLATE,分别表示模版编译目录和模版文件目录:define('DIR_COMPI
TPTtiny php template
0
PHP Simple HTML DOM Parser
这是一个 PHP5 的 HTML 文档解析器,示例代码:// Create DOM from URL
PHP Simple HTML DOM Parser
0
PHP Simple HTML DOM Parser
这是一个PHP5的HTML文档解析器,示例代码://CreateDOMfromURLorfile$html=file_get_html('http://www.google.com/');//Find
PHP Simple HTML DOM Parser
0
Message Template
一个简单的短信模版应用。即为某个联系人制定好短信模版,加上联系人的手机好吗,之后直接点击这个联系人,就会跳转到设备发短信的界面,并且自动填充之前已经定制好的短息内容。Demo还可以读取设备的通讯录。[
Message Template
0
Ease Template
EaseTemplate模板能够改善网站的结构,其特点有:*可以在几秒钟改变整个站点的外观;*可以让网站更容易实现多语言;*抽象程序设计,没有垃圾HTML代码;*稳定性能初期的强大甚至超越混编代码;*
Ease Template
0