摘要:<?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模板引擎使用框架來渲染頁面就簡單多了