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

objects in smarty

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


Joined: 30 Apr 2003
Posts: 19
Location: Suhr, Switzerland

PostPosted: Mon Jun 16, 2003 3:41 pm    Post subject: objects in smarty Reply with quote

Hi

I've the following problem if i use the following code:

Code:

{assign var=test value="Example: $obj->name"}
{$test}

output:
Example: Object->name


i've to do a workaround:

Code:

{assign var=name value=$obj->name
{assign var=test value="Example: $name"}
{$test}


is there another solution like "Example: ".$obj or something else? would this be fixed in the next Smarty-Version?

thanks a lot.

Mischa
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Jun 16, 2003 4:31 pm    Post subject: Reply with quote

see: http://smarty.php.net/manual/en/language.syntax.quotes.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mischa
Smarty Rookie


Joined: 30 Apr 2003
Posts: 19
Location: Suhr, Switzerland

PostPosted: Mon Jun 16, 2003 8:07 pm    Post subject: Reply with quote

i've tried the following code:
Code:

{assign var=test value="test: `$addr->addr_id`"}
{$test}

output:

test: `Object->addr_id`


is my code wrong? do i use the wrong quotes?

i use smarty-version 2.5.0.

thanks for help.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Jun 16, 2003 8:41 pm    Post subject: Reply with quote

um, sorry. i would have expected your example to work. i see it doesn't.
it seems you have to work around it with a 2nd {assign} for now.but i will see if we can fix this for the next version of smarty.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mischa
Smarty Rookie


Joined: 30 Apr 2003
Posts: 19
Location: Suhr, Switzerland

PostPosted: Mon Jun 16, 2003 9:30 pm    Post subject: Reply with quote

ok. that's no problem for me.

and thanks for helping!
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Tue Jun 17, 2003 12:08 am    Post subject: Reply with quote

I agree that mischa's syntax SHOULD work.

Meanwhile, try this:
{assign var=test value="test"|concat:$addr->addr_id}
Back to top
View user's profile Send private message
mischa
Smarty Rookie


Joined: 30 Apr 2003
Posts: 19
Location: Suhr, Switzerland

PostPosted: Tue Jun 17, 2003 8:00 am    Post subject: Reply with quote

concat doesn't work, but with

Code:

{assign var=test value="test"|cat:$addr->addr_id}


it works! Wink

thanks, my code will be a little bit shortet. i hope the new version with a bugfix coming soon!
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Tue Jun 17, 2003 8:27 am    Post subject: Reply with quote

Embarassed I did type concat! sheesh. Thanks for posting the correction, mischa Smile
Back to top
View user's profile Send private message
mischa
Smarty Rookie


Joined: 30 Apr 2003
Posts: 19
Location: Suhr, Switzerland

PostPosted: Tue Jun 17, 2003 8:33 am    Post subject: Reply with quote

no problem!

i guess it's the weather... too hot for programming! Wink
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Thu Jun 19, 2003 12:07 am    Post subject: Reply with quote

the cvs-version of smarty recognizes -> in backticks correctly. i must have overlooked that somebody has fixed this already. Smile
Back to top
View user's profile Send private message Send e-mail 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 -> 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