|
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 |
jn Smarty Rookie
Joined: 29 Sep 2003 Posts: 7 Location: Germay
|
Posted: Sun Oct 05, 2003 2:44 pm Post subject: using function result as attribute to another function |
|
|
The title says it: Can a result of a function be an attribute of another function:
Here is a sample:
Code: | {assign var="foo" value="bar"}
{$foo}
<hr>
{mailto address="me@domain.com"}
<hr>
{assign var="foo" value=mailto address="me@domain.com"}
{$foo}
<hr>
{assign var="foo" value=`mailto address="me@domain.com"`}
{$foo}
<hr>
{assign var="foo" value="`mailto address=me@domain.com`"}
{$foo}
<hr>
{assign var="foo" value={mailto address="me@domain.com"}}
{$foo}
<hr>
{assign var="foo" value="{mailto address="me@domain.com"}"}
{$foo}
| This give sme the folloging output:
Quote: | bar
--
me@domain.com
--
mailto
--
`mailto
--
`mailto address=me@domain.com`
--
} {mailto
--
"} "{mailto address="me@domain.com
| Of course, the first two are only as a soft of self-control if the assign and the mailto functions are working by themselfes...
Now, the question is: how to I get the results of the mailto function to be the attribute of the assign function? As you see, backticks are not working. Using Code: | {assign var="foo" value="`mailto address="me@domain.com"`"} | even gives me a syntax error in the compiled template!
(please note that assign and mailto are here just as examples, I need this mechanism for a couple of selfmade plugins)
Any help is greatly appreciated,
Jörg |
|
Back to top |
|
Troublegum Smarty Rookie
Joined: 07 Sep 2003 Posts: 33 Location: Germany
|
|
Back to top |
|
jn Smarty Rookie
Joined: 29 Sep 2003 Posts: 7 Location: Germay
|
Posted: Sun Oct 05, 2003 6:05 pm Post subject: |
|
|
Thank you very much, Troublegum; that did it and solved my problem. Not very intuitive....
BTW: searching the forums for "capture" I found a thread I didn't find previously here. This thread which covers my problem as well.
Tschö,
Jörg |
|
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
|