課程
/后端開發(fā)
/PHP
/MVC架構(gòu)模式分析與設(shè)計(jì)
.....
2016-09-06
源自:MVC架構(gòu)模式分析與設(shè)計(jì) 5-3
正在回答
報(bào)錯(cuò)了 ?文件路徑和名字都對(duì)
<?php
require('../smarty/Smarty.class.php');
$smarty = new Smarty();
// 配置
$smarty->left_delimiter = "{"; //左定界符
$smarty->right_delimiter = "}"; //右定界符
$smarty->template_dir="tpl"; ? //設(shè)置模板目錄
$smarty->compile_dir = "template_c"; //模板編譯生成的文件
$smarty->cache_dir = "cache"; //緩存
//以下是開啟緩存的另兩個(gè)配置. 因?yàn)橥ǔ2挥胹marty的緩存機(jī)制. 所以此項(xiàng)為了解.
//$smarty->caching = true ; ? ?//開啟緩存
//$smarty->cache_liftime = 120 ; ? ?//緩存時(shí)間
$smarty->assign('test','文章標(biāo)題');
$smarty->display('test.tpl');
舉報(bào)
通過(guò)學(xué)習(xí)MVC理論知識(shí),由淺入深帶您實(shí)現(xiàn)人生第一個(gè)MVC框架
3 回答報(bào)錯(cuò) 不知道怎么回事
1 回答這是怎么回事
2 回答按照老師的代碼打,老是報(bào)錯(cuò)是怎么回事
1 回答這是怎么回事呢
4 回答不知道怎么回事
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-09-07
報(bào)錯(cuò)了 ?文件路徑和名字都對(duì)
<?php
require('../smarty/Smarty.class.php');
$smarty = new Smarty();
// 配置
$smarty->left_delimiter = "{"; //左定界符
$smarty->right_delimiter = "}"; //右定界符
$smarty->template_dir="tpl"; ? //設(shè)置模板目錄
$smarty->compile_dir = "template_c"; //模板編譯生成的文件
$smarty->cache_dir = "cache"; //緩存
//以下是開啟緩存的另兩個(gè)配置. 因?yàn)橥ǔ2挥胹marty的緩存機(jī)制. 所以此項(xiàng)為了解.
//$smarty->caching = true ; ? ?//開啟緩存
//$smarty->cache_liftime = 120 ; ? ?//緩存時(shí)間
$smarty->assign('test','文章標(biāo)題');
$smarty->display('test.tpl');