Dynamic Constants (config)
| From: | Hinrich Donner | Date: | Wed, 26 Feb 2003 12:41:32 +0000 |
| Subject: | Dynamic Constants (config) | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-8216@lists.php.net to get a copy of this message | ||
Hi,
I like to use the config_load for a multi language feature. To handle this
in some special cases (e.g. error messages), I'm looking for a possibility
to join a variable and a constant, for example:
{if $error_code neq 0}
<span class="error">
<h1>{#ERROR_TITLE#}</h1>
<p>{#ERROR_TEXT_$error_code#}</p>
</span>
{/if}
In that example the error code has an integer value. In the config file
the constants are defined for example:
ERROR_TITLE="Error"
ERROR_TEXT_1="File not found."
ERROR_TEXT_2="Fille access not allowed."
ERROR_TEXT_3="Foo your bar."
[de]
ERROR_TITLE="Fehler"
I hope, you understand what I like to do.
Thanks for any help
Hinrich
--
Hinrich Donner