|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
till Smarty Rookie
Joined: 25 Feb 2004 Posts: 19 Location: Berlin, Germany
|
Posted: Thu Jul 08, 2004 12:27 pm Post subject: eval() in smarty? |
|
|
Ich hol mir Smarty Template Code aus einer Datenbank und schieb's ueber eine Variable in mein Template (was im FS liegt). Gibt's ne Moeglichkeit so etwas wie eval() an dieser Stelle zu nutzen und die Interpretation zu erzwingen?
Zum Beispiel:
[php:1:3513aa7073]
<?php
...
$smarty->assign('my_code', '{if $blah eq '1'}do this{else}do that{/if}');
$smarty->display('my.tpl');
?>[/php:1:3513aa7073]
In my.tpl:
|
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Thu Jul 08, 2004 12:39 pm Post subject: |
|
|
ja, {eval}.
es ist aber besser für templates aus einer datenbank ein resource-plugin zu schreiben, als eval zu verwenden.
steht beides im manual. |
|
Back to top |
|
till Smarty Rookie
Joined: 25 Feb 2004 Posts: 19 Location: Berlin, Germany
|
Posted: Thu Jul 08, 2004 12:46 pm Post subject: |
|
|
Genialomat. Muss ich wohl ueberlesen haben! Danke fuer die Antwort. |
|
Back to top |
|
|
|
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
|