后端开发|php教程
smarty,自定义,函数,htmlcheckboxes,用法
后端开发-php教程
本文实例讲述了smarty自定义函数htmlcheckboxes用法。分享给大家供大家参考。具体如下:
nehe opengl 源码,ijulia vscode,ubuntu未发现软件包,tomcat总是配置失败怎么办,sqlite空间类型,网页设计的建多大的,app服务器维修,jq拖拽排序插件,在线Excel前端框架,php爬虫框架哪个好用,nginx不解析php,小郑seo,网站内容下载,网页影视源码,天空下载网站模板,js 页面加载等待效果,silverlight权限管理系统,asp程序加上授权代码lzw
访问文件:index.php:
手机html导航源码,ubuntu 安裝ttf,飞蛾是爬虫吗,usdt支付PHP,晋江seo营销lzw
<?php
require_once(libs/Smarty.class.php);
$smarty = new Smarty();
$smarty->setTemplateDir($_SERVER[DOCUMENT_ROOT]."/php/templates/");
$smarty->setCompileDir($_SERVER[DOCUMENT_ROOT]."/php/templates_c/");
$smarty->setCacheDir($_SERVER[DOCUMENT_ROOT]."/php/cache/");
$smarty->caching = false;
xocde web网页源码,vscode 自动生成分号,ubuntu web部署,tomcat服务自动恢复,爬虫字体解密,对象调用静态方法 php,头条seo优化关键词,音乐网站源码PHP程序,ps智能模板下载lzw
$smarty->assign(cust_ids,array(1000,1001,1002,1003));
$smarty->assign(cust_name,array("喜洋洋","美洋洋","懒洋洋","哈哈哈"));
$smarty->assign(customer_id,1001);
$smarty->display("temp.htm");
?>
模板文件:temp.htm
{html_checkboxes values=$cust_ids output=$cust_name selected=$customer_id}
测试结果:utf-8下显示正常,但文件编码为ANSI时,中文不能显示。