PHP 对 Smarty 友好
PHP friendly for Smarty
{php}
$from = 'EUR';
$to = 'RON';
$url = 'http://finance.yahoo.com/d/quotes.csv?f=l1d1t1&s='.$from.$to.'=X';
$handle = fopen($url, 'r');
if ($handle) {
$result = fgetcsv($handle);
fclose($handle);
}
$suma = $result[0];
$totall = round($suma * $euroi, 2);
{/php}
我试图将此 php 代码转换为 Smarty ("Friendly") PHP 代码,但我不知道哪里出了问题。我收到此错误:
Smarty Error: Syntax error in template "/home2/hostro/public_html/templates/VoiceHost/viewinvoice.tpl" on line 131 "{php}" unknown tag "php"
第 131 行是 {php}
你能帮助我吗 ?谢谢 !
P.S: 我已经阅读了 Smarty 的文档,但不知道..
PPS:我在Whosebug上搜索了类似的问题...
{php} tags are deprecated from Smarty, and should not be used. Put
your PHP logic in PHP scripts or plugin functions instead.
Note: As of Smarty 3.1 the {php} tags are only available from
SmartyBC.
{php}
$from = 'EUR';
$to = 'RON';
$url = 'http://finance.yahoo.com/d/quotes.csv?f=l1d1t1&s='.$from.$to.'=X';
$handle = fopen($url, 'r');
if ($handle) {
$result = fgetcsv($handle);
fclose($handle);
}
$suma = $result[0];
$totall = round($suma * $euroi, 2);
{/php}
我试图将此 php 代码转换为 Smarty ("Friendly") PHP 代码,但我不知道哪里出了问题。我收到此错误:
Smarty Error: Syntax error in template "/home2/hostro/public_html/templates/VoiceHost/viewinvoice.tpl" on line 131 "{php}" unknown tag "php"
第 131 行是 {php}
你能帮助我吗 ?谢谢 !
P.S: 我已经阅读了 Smarty 的文档,但不知道..
PPS:我在Whosebug上搜索了类似的问题...
{php} tags are deprecated from Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin functions instead.
Note: As of Smarty 3.1 the {php} tags are only available from SmartyBC.