smarty模板 section用法
发布时间:2023-05-11 编辑:jiaochengji.com
教程集为您提供smarty模板 section用法等资源,欢迎您收藏本站,我们将为您提供最新的smarty模板 section用法资源
php文件
$vo = array();
$trackback_i =0 ;
$trackback_query = "SELECT t_id,title,t_datetime,t_excerpt,url,blog_name FROM table_tbacks where t_id='$article' ORDER BY t_datetime LIMIT 0,40";
$idx = 0;
$this->_db->query($trackback_query) ;
while ($trackbacki_m_message = $this->_db->fetch_array($trackback_query))
{
$vo[] = $trackbacki_m_message;
$trackback_i ;
}
$this->_tpl->assign('vo',$vo);
$this->_tpl->assign('trackback_ti',$trackback_i);
//trackback end
$this->_setTplCommon('g.tpl');
模板文件 g.tpl
<{if $trackback_ti !==0 }>
<h2 class="textone"> trackback引用通告</h2>
<{section name=vo loop=$vo}>
<p class="one">感谢<a href="<{$vo[vo].url}>" class="atricle"><{$vo[vo].title}></a>引用了本文,来自“<{$vo[vo].blog_name}>”,<{$vo[vo].excerpt}>
[<a href="<{$vo[vo].url}>" class="atricle">阅读更多细节</a>]
<{/section}>
<{/if}>
您可能感兴趣的文章:
有关smarty的基本设置
smarty模板中get、post、request、cookies、session变量用法
smarty模板中类似for循环功能的实现代码
smarty获得当前url示例代码
有关smarty模板引擎生成静态页的关键代码
php smarty 基础
smarty 模板if else使用实例与入门教程
在php中配置使用smarty模板引擎
php模版生成html的小例子
PHP模板引擎Smarty缓存使用
上一篇:php与html分离程序
下一篇:Smarty模板快速入门
[关闭]