Smarty config files problem with HTML_QuickForm_Renderer_ArraySmarty
| From: | Nicolas de Bari Embriz Garcia Rojas | Date: | Sat, 21 Jan 2006 02:35:08 +0000 |
| Subject: | Smarty config files problem with HTML_QuickForm_Renderer_ArraySmarty | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-22630@lists.php.net to get a copy of this message | ||
Hi all, I am currently using smarty config files for making a multilingual application i am using something like this:
english.conf
[name_form]
whats_your_name = What is your name?
first_name = First Name
last_name = Last Name
submit = Submit
spanish.conf
[name_form]
whats_your_name = ¿Cuál es su nombre?
first_name = Nombre
last_name = Nombre Pasado
submit = enviar
and then something like this:
template.tpl
{config_load file="$LANGUAGE" section="name_form"}
<html>
<head>
<h3>{#whats_your_name#}</h3>
<form method="post" action="">
{#first_name#}: <input type="text" name="first_name" value=""><br>
{#last_name#}: <input type="text" name="last_name" value=""><br>
<input type="submit" name="action|Submit" value="{#submit#}">
</form>
that is working fine but when I use HTML_QuickForm_Render_ArraySmarty I have not found the way for reading the conf files i have something like this:
$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl);
$renderer->setRequiredTemplate(
'{if $error}
<font color="red">{$label}</font>
{else}
{$label}
{if $required}
<font color="red" size="1">*</font>{/if} {/if}' ); i have all ready try to put a plugin replacing $label with {#$label} but did not work. any ideas on how to make this to work. Regards.