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

Strange scope problem

 
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 -> General
View previous topic :: View next topic  
Author Message
datenpunk
Smarty Rookie


Joined: 17 May 2003
Posts: 6

PostPosted: Sun Jul 06, 2003 11:16 pm    Post subject: Strange scope problem Reply with quote

I have a template which contains some custom functions.

Now I parse the content:
Code:

<{eval var=$content|nl2br}>


Within a function inside this parsed content there is a
Code:

$smarty->assign('myflag', true);


Ok - now comes the strange part:
The function works on a copy of $smarty but I use the referenced &$smarty Object to set myflag.
If I now want to output myflag inside the same column wher the content is located I get nothing back.
BUT for the next column it works:

Simplyfied example:
Code:

<table>
 <tr>
   <td>
    <{eval var=$content|nl2br}>
    <{$myflag}>
   </td>
   <td>
    <{$myflag}>
   </td>
 </tr>
</table>


Basically I don't understand the scope smarty has I think.

Thanks in advance

Daniel Khan
Back to top
View user's profile Send private message
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 -> General 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