|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
doge Smarty n00b
Joined: 03 Dec 2019 Posts: 3
|
Posted: Wed Dec 04, 2019 5:22 am Post subject: Block function to replace multiple %string with text |
|
|
I created a block function code but it is doesn't work, here is the code
Code: | function smarty_block_t($params, $string, &$smarty) {
foreach($params as $key => $value) {
$params["%$key"] = $value;
unset($params[$key]);
}
} |
The function is to replace a string with '%' tag into its text, for example
Code: | {t sitename=http://smarty.com}%sitename is a cool web{t} |
OR
Code: | {t sitename=smart siteurl=http://smarty.com}%sitename is a cool web at %siteurl{t} |
Can someone help me figure it out? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|