Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Dedicated server web hosting provided by Guru-host.eu.
Dynamische conf...

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
Carnage
Smarty Rookie


Joined: 05 Nov 2004
Posts: 7

PostPosted: Sun Jan 23, 2005 4:07 pm    Post subject: Dynamische conf... Reply with quote

Hi.

Ich habe in meinem Skript folgende Ausgabe versucht:

->php<-
Code:
         $_POST["nachricht"] = "error_1";
         $content = $smarty->fetch($_SESSION["template"]."/sys_message.tpl");
         $smarty->assign("nachricht","error_1");
         $smarty->assign("content",$content);
         $smarty->display($_SESSION["template"]."/main.tpl");



->tpl<-
Code:
{config_load file="languages/lang_$lang.conf" section="sys_message"}
Nachricht: ->{$smarty.post.nachricht}<-<br>
Ausgegeben: ->{$smarty.config.$nachricht}<-<br>
Var-Nachricht: ->{$nachricht}<-


Nur irgendwie zeigt er bei dem "Ausgeben" nicht die Nachricht an welche in der Config angegeben ist (in diesem Fall "error_1"). Er zeigt mir auch nicht die Variable $nachricht an, welche ich ja eigentlich per assign übergeben habe.

Hat jemand ne Idee was ich falsch mache =( ?
Back to top
View user's profile Send private message
Kidchaos
Smarty Rookie


Joined: 10 Sep 2004
Posts: 9
Location: Berlin

PostPosted: Tue Jan 25, 2005 9:01 am    Post subject: Reply with quote

Hi,

zeigt er dir überhaupt etwas an? Denn es kann ja auch sein das $_SESSION["template"] leer ist und er so die sys_message.tpl bzw. die main.tpl erst garnicht laden kann.

Hast du auch schonmal Probiert die Variable z.B. asdfjkloe123 zu nennen? Denn wenn in einem anderem Script die Variable {$nachricht} nochmal definiert wird könnte es ja sein das hier der Fehler liegt.

Bye
Back to top
View user's profile Send private message
Carnage
Smarty Rookie


Joined: 05 Nov 2004
Posts: 7

PostPosted: Tue Jan 25, 2005 4:43 pm    Post subject: Reply with quote

Ja die gibt er alle aus und das umbenennen nützt leider nix =(.
Back to top
View user's profile Send private message
CirTap
Smarty Pro


Joined: 04 Jun 2003
Posts: 106

PostPosted: Tue Feb 01, 2005 2:50 pm    Post subject: Reply with quote

Hi,

{config_load file="languages/lang_$lang.conf" section="sys_message"}
geht nicht, AFAIK must du `backticks` verwenden, um eine Variable innerhalb eines String aufzulösen, oder speichere den Pfad zur conf Datei gleich ganz in einer Variablen anstelle in im Template zusammenzusetzen:
[php:1:b4a8581215]$smarty->assign("config_lang","languages/lang_" . $lang .".conf");[/php:1:b4a8581215]
Code:
{config_load file=$config_lang section="sys_message"}


Viel Spaß,
CirTap
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP