亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Smarty模板進(jìn)行數(shù)據(jù)類型渲染輸出

原創(chuàng) 2019-02-25 11:51:14 268
摘要:<?phprequire __DIR__.'/config/config.php';session_start();class Test{   public  $site='php中文網(wǎng)';   public function welcome(){       return'歡迎來到'

<?php
require __DIR__.'/config/config.php';
session_start();
class Test{
  public  $site='php中文網(wǎng)';
  public function welcome(){
      return'歡迎來到'.$this->site;
  }
}
function add($a,$b){
   return $a+$b;
}
$test=new Test();
//設(shè)置常量。不用賦值
const SITE_NAME='努力學(xué)習(xí)';
//系統(tǒng)常量
$_POST['username']='天天向上';
$_GET['username']='少兒不努力,老大徒傷悲';
$_SESSION['pass']=sha1('123456');
$smarty->assign('test',$test);
$smarty->display('demo6.html');

批改老師:韋小寶批改時間:2019-02-25 11:56:53
老師總結(jié):寫的很不錯 Smarty模板引擎有很多的框架都在使用 學(xué)習(xí)好了Smarty模板引擎使用框架來渲染頁面就簡單多了

發(fā)布手記

熱門詞條