Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Global Assign Wert

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
iclone
Smarty n00b


Joined: 04 Dec 2012
Posts: 2
Location: Germany

PostPosted: Tue Dec 04, 2012 9:51 pm    Post subject: Global Assign Wert Reply with quote

Hi,

und zwar hab ich da mal eine Frage. Ist es möglich in einer HTML erstellten Variable, in einer anderen HTML aufzurufen?

also in einer HTML Datei habe ich z.B:
Code:
{assign var="counter" scope="global" value=$smarty.foreach.aussen.iteration}


und in einer anderen HTML Datei wollte ich dann die Variable mit
Code:
{$counter}

anzeigen lassen.

Lg

iclone
Back to top
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 172
Location: Germany

PostPosted: Wed Dec 05, 2012 7:01 am    Post subject: Reply with quote

Hi,

so lange die "zweite" HTML datei in der ersten oder in einer Art Container für alle HTML-Dateien aufgerufen wird (also sprich da wo die 1. Datei geladen wird, wird auch die zweite geladen), funktioniert es. Aber auch nur wenn du als scope "global" nimmst. Ich weiß zwar nicht warem, aber bei mir gab es aus irgendeinem Grund mal das verhalten, dass es bei einer Situation, wenn ich ein Template zusätzlich dazulade, nicht funktioniert hat!
Back to top
View user's profile Send private message Visit poster's website
iclone
Smarty n00b


Joined: 04 Dec 2012
Posts: 2
Location: Germany

PostPosted: Wed Dec 05, 2012 11:22 am    Post subject: Reply with quote

Hi Grizzly

hmm, glaube das wird bei einem Shop System nicht so einfach funktionieren oder doch? Müsste doch eigentlich nur eine Datei in die andere Datei laden


Vg
Back to top
View user's profile Send private message
Grizzly
Smarty Pro


Joined: 15 Apr 2011
Posts: 172
Location: Germany

PostPosted: Wed Dec 05, 2012 11:52 am    Post subject: Reply with quote

Verstehe nicht genau was du meinst.

wenn du zum Beispiel eine index.html hast und in dieser SMARTY verwendest, dann würde es ja z. B. so aussehen

Code:

<html>
<head>
</head>
<body>
{include file="test.html"} {*in dieser test.html initialisierst du die Variable test über {assign var="test" scope="global" value='test'}*}

{include file="test2.html"} {* in dieser test2.html greifst du auf die globale Variable test über {$test} zu *}
</body>
</html>
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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