[SMARTY] variable on config file
"Wiwid Lukiyanto" <[email protected]> Thu, 9 Aug 2007 06:53:59 +0700
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <024501c7da17$71727d20$0301a8c0@lucky> |
Hi,
I have URL like:
user.php?option=add_success&id=lucky
I want output like this: User lucky successfully added
I confuse how to buld that with config file and tpl file. I must use config
file, because it will have more than 1 language. I do this on english
language config file:
english.conf:
**********
add_success = "User %s successfully added", $smarty.get.id
**********
tpl file:
**********
{if $smarty.get.option == "add_success"}{#add_success#}{/if}
**********
But it didn't work. I also read about eval on help file, but I still confuse
how to use eval for this problem. Eval on smarty help file only have example
variable from the config file, not from other resources like GET or POST. I
copy-paste that:
*****************************************************
setup.conf
----------
emphstart = <b>
emphend = </b>
title = Welcome to {$company}'s home page!
ErrorCity = You must supply a {#emphstart#}city{#emphend#}.
ErrorState = You must supply a {#emphstart#}state{#emphend#}.
*****************************************************
OK, there is $company on there, but on help file I don't know where $company
from.
Can anybody help me to solve this problem? Thank you very much
LuckyGuy354
IT Beginner
http://www.wiwid.org
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php