因為我在smarty 上不能直接用php的rawurldecode ,所以自已寫了一個smarty 的function 傳回rawurldecode 過的值給smarty 就這樣而已…..
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
function smarty_function_rawurldecode ($params, &$smarty) {
if (empty($params[‘lastpage_url’])){
$smarty->_trigger_fatal_error(“[rawurldecode] param lastpage_url cannot be empty”);
return;
}
if (isset($params[‘lastpage_url’])){
$return = $params[‘lastpage_url’];
$return = rawurldecode($return);
}
return $return;
}
?>
reference…
How to write a custom Smarty function in php
:(h):