<?php
require_once('../smarty/Smarty.class.php');

//配置信息
$smarty=new Smarty();

$smarty->left_delimiter="{";
$smarty->right_delimiter="}";
$smarty->template_dir="tpl";
$smarty->compile_dir="template_c";
$smarty->cache_dir="cache";

$smarty->caching=true;
$smarty->cache_lifetime=120;

class my_object{

function meth1($param){

return $param[0].'已经'.$param[1];
}
}
$myobj=new my_object();
$smarty->assign('myobj',$myobj);
$smarty->display("test.html");

?>
//********test.html*******************
<!doctype html>
<html>
<meta charset="utf-8">
<head></head>
<body>
<!--以数组形式-->
{$myobj->meth1(array('苹果','熟了'))}
</body>
</html>

相关文章:

  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2021-10-20
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-07
相关资源
相似解决方案