[prev in list] [next in list] [prev in thread] [next in thread] 

List:       smarty-general
Subject:    Re: [SMARTY] Concatenated string as array index
From:       Thomas Pundt <thomas () pundt ! de>
Date:       2004-05-27 8:18:56
Message-ID: 200405271018.56548.thomas () pundt ! de
[Download RAW message or body]

Hi,

On Wednesday 26 May 2004 17:38, David Förster wrote:
| I don't think that's possible. I'd rather recommend to change the array
| slightly:
|
| $entry = array(
| 	"de" => array(
| 		"text" => "Deutscher text",
| 		"head" => "Deutsche Ueberschrift",
| 	)
| 	"en" => array(
| 		"text" => "english text",
| 		"head" => "english headline",
| 	)
| );
|
| That'd be easier to handle.

yes, I've done it that way, too:

$lang = array(
	"de" => array(
		"text" => "Deutscher text",
		"head" => "Deutsche Ueberschrift",
	)
	"en" => array(
		"text" => "english text",
		"head" => "english headline",
	)
);

$tpl->assign("lang",$lang[$language]);

and in the template use {$lang.text} and {$lang.head} - quite simple.

Ciao,
Thomas

-- 
Thomas Pundt -------------------------- http://pundt.de/ ---------------------
EMail: Thomas Pundt <thomas@pundt.de> | Schlossstrasse 42, D-40477 Duesseldorf

-- 
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic