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

smarty高級(jí)特性之對(duì)象的使用方法

 更新時(shí)間:2015年12月25日 14:51:11   作者:釋然me  
這篇文章主要介紹了smarty高級(jí)特性之對(duì)象的使用方法,結(jié)合實(shí)例形式簡(jiǎn)單分析了使用類(lèi)與對(duì)象的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了smarty高級(jí)特性之對(duì)象的使用方法。分享給大家供大家參考,具體如下:

<?php
include_once('smarty.inc.php');
class Dog{
 public $name;
 public function sayHello(){
 echo 'hello';
 }
}
$dog1=new Dog();
$dog1->name="first dog";
$smarty->assign("dog",$dog1);
$smarty->display('test.tpl');
?>

test.tpl文件:

屬性調(diào)用:{$dog->name}<br />
方法調(diào)用:{$dog->sayHello()}

輸出顯示:

first dog
hello

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

相關(guān)文章

最新評(píng)論