正在回答 回答被采纳积分+1
2回答
guly
2018-01-26 10:02:07
你好,渲染模板应该加上smarty类函数的,PHP中应加载smarty类文件。具体代码如下:
test.php
1 2 3 4 5 6 7 8 9 | <?php define( 'IN_ECS' , true); require (dirname( __FILE__ ) . '/includes/init.php' ); $action = isset( $_REQUEST [ 'act' ]) ? trim( $_REQUEST [ 'act' ]) : '' ; if ( $action == '' ) { $smarty ->display( 'test.dwt' ); } ?> |
test.dwt
1 2 3 4 5 6 7 8 9 10 | < link rel = "shortcut icon" href = "favicon.ico" /> < link rel = "icon" href = "animated_favicon.gif" type = "image/gif" /> < link href = "{$ecs_css_path}" rel = "stylesheet" type = "text/css" /> {* 包含脚本文件 *} {insert_scripts files='common.js'} </ head > < body > < h1 >测试模板渲染</ h1 > </ body > </ html > |
效果为:
如果解决您的问题请采纳,祝学习愉快!
ECShop3从基本使用到二次开发
- 参与学习 387 人
- 提交作业 102 份
- 解答问题 238 个
从基本使用到独立模块定制开发,深入解析ECShop源码,了解PHP编程思想,一步步打造属于你的大型网上商城!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧