请了解PHPLIB的兄弟谈谈对它的看法! phplib从php3开始开发,是元老了。现在停止开发也是很正常的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 phplib短小一些smarty大一些,功能强大仅用过这两种模板 用它不如用smartTemplate,编译型的肯定要比解释型的快 phplib分离得不够彻底,使用得时候经常还是需要考虑到数据得结构在程序里作处理 phplib还可以,不过多层循环不方便phpbb还用phplibsmartTemplate也不错,不过好像一定要放在当前目录下如果是自已的主机无所谓,可以放在pear目录可以用这个smarty-lighthttp://www.paullockaby.com/projects/smarty-light/还有smarty我用smarty 写的留言板要1秒多我其它不变换成smarty-light,和,smartTemplatesmartTemplate 要0.03 秒左右smarty-light 也差不多,快一点吧大概0.025右右还有php5好像比php4慢正在为难中。如果用php5可以用pdo,直接使用soap如果用php4 用soap又慢,因为php4没有内置soap 听说tinybutstrong模板构思很巧妙 而且几乎可以使模板与程序完全分离~ 不过E文太差 网上找不到中文文档 郁闷中 看来学好英语还是很重要的哦 :( 楼主,“听说tinybutstrong模板构思很巧妙,而且几乎可以使模板与程序完全分离”有点言过其实了!tinybutstrong确实比phplib的template要好一些,但绝不是你听说的那么好。这是tinybutstrong的一个示例模板<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>TinyButStrong</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="tbs_us_examples_0styles.css" rel="stylesheet" type="text/css"></head><body><p align="center" class="title-page">Example of dynamic columns</p><table width="500" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td>Creating dynamic columns with TinyButStrong is simple but a bit delicate. It doesn't need any specific parameter. But you have to think to expand columns on every rows of the basic table using a <u>different</u> bloc for <u>each</u> row. Columns must be merged before rows.</td> </tr></table><br><table width="500" border="0" align="center" cellpadding="4" cellspacing="2"> <tr> <td class="text-section2">In this example, the script creates a multiplication table with alternated row's color. You can change the number of columns and rows.</td> </tr> <tr> <td><form action="[var..script_name]" method="get" name="frm_nbr" id="frm_nbr"> <div align="center">Number of rows: <input name="nbr_row" type="text" id="nbr_row" value="[var.nbr_row]" size="2" maxlength="2" style="width:30px;"> Number of columns: <input name="nbr_col" type="text" id="nbr_col" value="[var.nbr_col]" size="2" maxlength="2" style="width:30px;"> <input name="btn_ok" type="submit" id="btn_ok" value=" Ok "> </div> </form></td> </tr> <tr> <td><table border="1" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#F0F0F0"> <td width="30" bgcolor="#FF9966"><div align="center">X</div></td> <td width="30" bgcolor="#FFD8B0"><div align="center" class="title-section"> <div align="center">[c0.key;block=td] </div> </div></td> </tr> <tr bgcolor="#F0F0F0"> <td bgcolor="#FFD8B0" class="title-section"><div align="center">[r.$;block=tr]</div></td> <td bgcolor="#DBDBDB"><div align="center">[r.[c1.val;block=td]] </div></td> </tr> <tr bgcolor="#F0F0F0"> <td bgcolor="#FFD8B0" class="title-section"><div align="center">[r.$;block=tr]</div></td> <td bgcolor="#FFFFFF"><div align="center">[r.[c2.val;block=td]] </div></td> </tr> </table></td> </tr></table></body></html>这是与之配套的php程序<?include_once('tbs_class.php') ;$TBS = new clsTinyButStrong ;$TBS->LoadTemplate('tbs_us_examples_dyncol.htm') ;// Retreiving user data if (!isset($_GET)) $_GET=&$HTTP_GET_VARS ;$nbr_row = (isset($_GET['nbr_row'])) ? intval($_GET['nbr_row']) : 10;$nbr_col = (isset($_GET['nbr_col'])) ? intval($_GET['nbr_col']) : 10;// List of column's names$columns = array();for ($col=1;$col<=$nbr_col;$col++) { $columns[$col] = 'column_'.$col;}// Creating data$data = array();for ($row=1;$row<=$nbr_row;$row++) { $record = array(); for ($col=1;$col<=$nbr_col;$col++) { $record[$columns[$col]] = $row * $col; } $data[$row] = $record;}// Expanding columns$TBS->MergeBlock('c0,c1,c2',$columns) ;// Merging rows$TBS->MergeBlock('r',$data) ;$TBS->Show() ;?> 从一开始就接触到了模板,phplib,smarty,smarttemplate...用了很长一段时间现在却越来越讨厌模板,正处于两难之间 回复:uuq(杜牧)smartTemplate也不错,不过好像一定要放在当前目录下如果是自已的主机无所谓,可以放在pear目录-------------------------------------------------可以设置$_CONFIG这个全局变量的 目前在用phplib,等有了时间,想研究一下别的模版 PHPLIB固然简单而且功不可没但毕竟是解释型的现在开始用smarttemplate了有机会研究下pear下PHPLIB的升级版本 jiangyuntao(姜运涛) 你误解了我是说程序文件不是模板我发现在以自己改一行程序就可以实现了161行 $header .= "include_once \"smarttemplate_extensions/smarttemplate_extension_$extension.php\";\n";$header .= "include_once \"".__FILE__."smarttemplate_extensions/smarttemplate_extension_$extension.php\";\n";或者自定义一个路径$header .= "include_once \"".__FILE__."smarttemplate_extensions/smarttemplate_extension_$extension.php\";\n"; PHPLIB现在有新版本了~~~大家不妨用用看与以前有啥区别! 请教各位PHP的CLI在C#中怎么用? PHP查询读不出字段值 数据检测问题...急在线= 让html也能执行php代码不能生效,高手帮忙,在线等! php简直 探讨:如何跟踪用户操作,象CSDN一样 这样的地址怎么处理才能抓取过来? 基于php.mysql动态网页生成静态网页技术 ●●●各位虾哥:像这种变量带来带去,不知你们有什么好的经验? 请问如何在PHP中连上SQL SERVER数据库啊? 请教phpwind的登陆页面怎么写?? 【Qihoo招聘】奇虎创业团队寻找工程师!
phpbb还用phplibsmartTemplate也不错,不过好像一定要放在当前目录下
如果是自已的主机无所谓,可以放在pear目录可以用这个smarty-light
http://www.paullockaby.com/projects/smarty-light/还有smarty
我用smarty 写的留言板要1秒多
我其它不变换成smarty-light,和,smartTemplate
smartTemplate 要0.03 秒左右
smarty-light 也差不多,快一点吧大概0.025右右还有php5好像比php4慢
正在为难中。如果用php5可以用pdo,直接使用soap
如果用php4 用soap又慢,因为php4没有内置soap
而且几乎可以使模板与程序完全分离~ 不过E文太差 网上找不到中文文档 郁闷中 看来学好英语还是很重要的哦 :(
有点言过其实了!
tinybutstrong确实比phplib的template要好一些,但绝不是你听说的那么好。这是tinybutstrong的一个示例模板
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TinyButStrong</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="tbs_us_examples_0styles.css" rel="stylesheet" type="text/css">
</head>
<body>
<p align="center" class="title-page">Example of dynamic columns</p>
<table width="500" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td>Creating dynamic columns with TinyButStrong is simple but a bit delicate. It doesn't need any specific parameter. But you have to think to expand columns on every rows of the basic table using a <u>different</u> bloc for <u>each</u> row. Columns must be merged before rows.</td>
</tr>
</table>
<br>
<table width="500" border="0" align="center" cellpadding="4" cellspacing="2">
<tr>
<td class="text-section2">In this example, the script creates a multiplication table with alternated row's color. You can change the number of columns and rows.</td>
</tr>
<tr>
<td><form action="[var..script_name]" method="get" name="frm_nbr" id="frm_nbr">
<div align="center">Number of rows:
<input name="nbr_row" type="text" id="nbr_row" value="[var.nbr_row]" size="2" maxlength="2" style="width:30px;">
Number of columns:
<input name="nbr_col" type="text" id="nbr_col" value="[var.nbr_col]" size="2" maxlength="2" style="width:30px;">
<input name="btn_ok" type="submit" id="btn_ok" value=" Ok ">
</div>
</form></td>
</tr>
<tr>
<td><table border="1" align="center" cellpadding="0" cellspacing="0">
<tr bgcolor="#F0F0F0">
<td width="30" bgcolor="#FF9966"><div align="center">X</div></td>
<td width="30" bgcolor="#FFD8B0"><div align="center" class="title-section">
<div align="center">[c0.key;block=td] </div>
</div></td>
</tr>
<tr bgcolor="#F0F0F0">
<td bgcolor="#FFD8B0" class="title-section"><div align="center">[r.$;block=tr]</div></td>
<td bgcolor="#DBDBDB"><div align="center">[r.[c1.val;block=td]] </div></td>
</tr>
<tr bgcolor="#F0F0F0">
<td bgcolor="#FFD8B0" class="title-section"><div align="center">[r.$;block=tr]</div></td>
<td bgcolor="#FFFFFF"><div align="center">[r.[c2.val;block=td]] </div></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>这是与之配套的php程序
<?include_once('tbs_class.php') ;$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('tbs_us_examples_dyncol.htm') ;// Retreiving user data
if (!isset($_GET)) $_GET=&$HTTP_GET_VARS ;
$nbr_row = (isset($_GET['nbr_row'])) ? intval($_GET['nbr_row']) : 10;
$nbr_col = (isset($_GET['nbr_col'])) ? intval($_GET['nbr_col']) : 10;// List of column's names
$columns = array();
for ($col=1;$col<=$nbr_col;$col++) {
$columns[$col] = 'column_'.$col;
}// Creating data
$data = array();
for ($row=1;$row<=$nbr_row;$row++) {
$record = array();
for ($col=1;$col<=$nbr_col;$col++) {
$record[$columns[$col]] = $row * $col;
}
$data[$row] = $record;
}// Expanding columns
$TBS->MergeBlock('c0,c1,c2',$columns) ;// Merging rows
$TBS->MergeBlock('r',$data) ;
$TBS->Show() ;?>
用了很长一段时间现在却越来越讨厌模板,正处于两难之间
smartTemplate也不错,不过好像一定要放在当前目录下
如果是自已的主机无所谓,可以放在pear目录
-------------------------------------------------
可以设置$_CONFIG这个全局变量的
而且功不可没
但毕竟是解释型的
现在开始用smarttemplate了
有机会研究下pear下PHPLIB的升级版本
我是说程序文件不是模板
我发现在以自己改一行程序就可以实现了
161行 $header .= "include_once \"smarttemplate_extensions/smarttemplate_extension_$extension.php\";\n";$header .= "include_once \"".__FILE__."smarttemplate_extensions/smarttemplate_extension_$extension.php\";\n";或者自定义一个路径
$header .= "include_once \"".__FILE__."smarttemplate_extensions/smarttemplate_extension_$extension.php\";\n";