Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

The correct usage of append ... ??

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
xces
Smarty Regular


Joined: 09 Apr 2004
Posts: 77

PostPosted: Wed Jun 02, 2004 8:30 am    Post subject: The correct usage of append ... ?? Reply with quote

I made some code using the append function:
Code:
$smarty->append('bla', 'You forgot your password');


However, i can't get it to work from my TPL:
Code:
{if count($bla) gt 0}Errors occured...{/if}


What am i doing wrong? When i print_r the smarty object, it shows this:
Code:
...
    [_tpl_vars] => Array
        (
            [bla] => Array
                (
                    [0] => You forgot your password.
                )

        )
   
...
So giving this above, it SHOULD work but it doesn't ... it is driving me crazy....
Back to top
View user's profile Send private message
kills
Smarty Elite


Joined: 28 May 2004
Posts: 493

PostPosted: Wed Jun 02, 2004 9:25 am    Post subject: Re: The correct usage of append ... ?? Reply with quote

xces wrote:
I made some code using the append function:
Code:
$smarty->append('bla', 'You forgot your password');



you have to use
Code:
$smarty->assign('bla', 'You forgot your password');
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Jun 02, 2004 9:57 am    Post subject: Reply with quote

@xces: there is nothing wrong with what you did and I can confirm that your example does indeed work.

EDIT: I notice now that you entered this as a bug because of difficulty you are having in relation to SmartyValidate. I have not been following that development, but if you are having an issue in that context, it is likely that it is an interaction issue with that system rather than a bug in Smarty itself.
Back to top
View user's profile Send private message
xces
Smarty Regular


Joined: 09 Apr 2004
Posts: 77

PostPosted: Wed Jun 02, 2004 12:17 pm    Post subject: Reply with quote

You are right boots, i think i found the problem. I checked for $bla before it was filled, kinda logical that is isn't set then.. You can delete this post if you wish Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs 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