亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

Smarty


<?php

/** * Example Application * * @package Example-application */

require '../libs/Smarty.class.php';

$smarty = new Smarty;

//$smarty->force_compile = true;

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

$smarty->assign("Name", "Fred Irving Johnathan Bradley Peppergill", true);

$smarty->assign("FirstName", array("John", "Mary", "James", "Henry"));

$smarty->assign("LastName", array("Doe", "Smith", "Johnson", "Case"));

$smarty->assign("Class", array(array("A", "B", "C", "D"), array("E", "F", "G", "H"), ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? array("I", "J", "K", "L"), array("M", "N", "O", "P")));

$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));

$smarty->assign("option_values", array("NY", "NE", "KS", "IA", "OK", "TX"));

$smarty->assign("option_output", array("New York", "Nebraska", "Kansas", "Iowa", "Oklahoma", "Texas"));

$smarty->assign("option_selected", "NE");

$smarty->display('index.tpl');

老師你好這是smarty demo中的index.php

兩個問題

1、沒有使用“五配置兩方法”

2、程序結束沒有“?>"

為什么它能運行

正在回答

1 回答

Smarty默認定界符就是{},單獨的PHP程序可以不要?> 計算機會把<?php以后的代碼都看做PHP程序來執行。在HTML中寫PHP時需要?> 這樣才能區分HTML代碼和PHP代碼

0 回復 有任何疑惑可以回復我~
#1

dy30319 提問者

非常感謝!
2015-09-25 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號