亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

smarty自定義函數(shù)htmlcheckboxes用法實(shí)例

 更新時(shí)間:2015年01月22日 11:26:34   投稿:shichen2014  
這篇文章主要介紹了smarty自定義函數(shù)htmlcheckboxes用法,實(shí)例分析了smarty模板與函數(shù)的使用技巧,需要的朋友可以參考下

本文實(shí)例講述了smarty自定義函數(shù)htmlcheckboxes用法。分享給大家供大家參考。具體如下:

訪問文件:index.php:

復(fù)制代碼 代碼如下:
<?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;

$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
復(fù)制代碼 代碼如下:
{html_checkboxes values=$cust_ids output=$cust_name selected=$customer_id}

測試結(jié)果:utf-8下顯示正常,但文件編碼為ANSI時(shí),中文不能顯示。

希望本文所述對大家的php程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評論