模板model1.htm代码:
|
1 2 3 4 立即学习“PHP免费学习笔记(深入)”; 5 6 7 8 9 10
v1.7.3.3 PrestaShop开源电子商务
查看详情
PrestaShop是一款针对web2.0设计的全功能、跨平台的免费开源电子商务解决方案,自08年1.0版本发布,短短两年时间,发展迅速,全球已超过四万家网店采用Prestashop进行布署。Prestashop基于Smarty引擎编程设计,模块化设计,扩展性强,能轻易实现多种语言,多种货币浏览交易,支持Paypal等几乎所有的支付手段,是外贸网站建站的佳选。Prestashop是目前为止,操作最
169
11 12 13 |
模板1 | 模板2 | {$title} {$content} |
模板model2.htm代码:
|
1 2 3 4 立即学习“PHP免费学习笔记(深入)”; 5 6 7 8 9 10 11 12 13 |
模板1 | 模板2 | {$title} {$content} |
模板model3.htm代码:
|
1 2 3 4 立即学习“PHP免费学习笔记(深入)”; 5 6 7 8 9 10 11 12 13 |
模板1 | 模板2 | {$title} {$content} |
php页面实现:
|
1 2 3 4 立即学习“PHP免费学习笔记(深入)”; 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
require 'libs/Smarty.class.php'; //包含Smarty类库文件 $smarty = new Smarty; //创建一个新的Smarty对象 $title = "Test"; $content = "This is a test!"; $smarty->assign("title",$title); //对模版中的变量赋值 $smarty->assign("content",$content); //对模版中的变量赋值 if(!isset($_GET['model'])) //根据参数选择不同的模板 { $smarty->display('model1.htm'); } else { if(file_exists('templates/'.'model'.$_GET['model'].'.htm')) //判断模板文件是否存在 { $smarty->display('model'.$_GET['model'].'.htm'); } else { echo "模板参数不正确!"; } } ?> |
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号