RE: [SMARTY] Dynamically using my configfile
| From: | Thomas Akkermans | Date: | Wed, 10 Apr 2002 09:53:54 +0000 |
| Subject: | RE: [SMARTY] Dynamically using my configfile | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-3602@lists.php.net to get a copy of this message | ||
Ok, thanks! That worked..!
This is the function:
function smarty_function_conf_var($params, &$this)
{
echo $this->_config[0]["vars"][$params["name"]];
}
--
Thomas
-----Original Message-----
From: Monte Ohrt [mailto:monte@ispi.net]
Sent: dinsdag 9 april 2002 18:18
To: Thomas Akkermans
Cc: smarty-general@lists.php.net
Subject: Re: [SMARTY] Dynamically using my configfile
Or, a workaround with a custom function:
{conf_var name=$message}
Where conf_var would take the value of name as name of the configuration
file variable name, and get this from the loaded config vars.
Thomas Akkermans wrote:
> Hi,
>
> I want to get some text from my config-file dynamically
> This is what I'm trying, but it won't work:
>
> [php]
> ..
> $text =3D "name";
> $smarty->assign("message", $name);
> ..
> [/php]
>
> [configfile]
> name =3D "teststring"
> name2 =3D "teststring2"
> [/configfile]
>
> [template]
> ..
> {#$message#}
> ..
> [/template]
>
>
> Does someone now how to solve this problem?
>
> --
> Thomas
>
--
Monte Ohrt <monte@ispi.net>
Director of Technology, ispi Inc.