用smarty来改变背景
来源:互联网 发布:anaconda linux下安装 编辑:程序博客网 时间:2024/05/29 17:06
今天我们老师让我们用smarty模板实现背景的转换,就纠结的写了部分代码
index.html
<form method="post" action=""> <!---选择背景->
<select name="bg">
<option value="">背景风格</option>
<option value="one">炫色风格</option>
<option value="two">卡通风格</option>
<option value="three">浪漫风格</option>
<option value="four">经典风格</option>
</select>
<input type="submit" value="确定" name="bgs">
</form>
index.php
if(isset($_REQUEST['bgs'])){ //判断是否选择背景
$bg=$_REQUEST['bg'];
$tpl->compile_dir ='./templates_c';
$tpl->assign("bg",$bg);
}
index.html
<{config_load file="foo.conf" section=$bg }>
<table border="<{$smarty.config.border}>" bgcolor=" <{$smarty.config.bgcolor}>"width="<{$smarty.config.width}>" >
<{elseif $smarty.foreach.out.last}>
<table border="2" width="500">
<{/if }>
foo.conf
#[自定义局部变量 背景颜色]
[one]
border = 3
bgcolor=#505050
width =570
[two]
border = 2
bgcolor=green
width =640
[three]
border = 4
bgcolor=blue
width =620
[four]
border = 5
bgcolor=#808080
width =590
- 用smarty来改变背景
- 用smarty实现背景改变
- 用smarty配置文件改变页面的风格
- android 用shape画出来的颜色做背景时,动态改变它的颜色值
- 改变背景
- TRACKBAR_CLASS (Trackbar Controls) 的背景颜色“实时”改变并不是想象中的用WM_ERASEBACKGROUND消息来解决
- android样式学习(一) 使用selector改变来动态改变背景颜色
- 在wpf datagrid中,想要根据一个条件来改变datagrid行的背景颜色
- UIWebView注入js代码来改变其背景颜色和尺寸大小
- 用CSS来控制网页的背景
- 自主改变背景
- 改变对话框背景颜色
- 循环改变背景颜色
- 改变td背景
- 改变对话框的背景
- 改变背景壁纸
- 改变进度条背景
- Aptana3 改变背景颜色
- ext js menu
- 心理学思考
- mysql模糊查询用法
- amg算法的尖尖角
- Qt中如何定制个性化菜单
- 用smarty来改变背景
- 使用预处理器进行调试(调试常量命令,文件名、行号、编译时间、日期)
- ext js menu
- how to become a software architect
- 过滤用户名(相当实用哦)
- Ubuntu的窗口模式与命令行模式切换
- ios实现国际化
- sock_init
- 项目需求分析