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

The Smarty '->' operator

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
abautu
Smarty n00b


Joined: 07 Oct 2003
Posts: 2

PostPosted: Tue Oct 07, 2003 2:15 pm    Post subject: The Smarty '->' operator Reply with quote

I like Smarty very much and I've been using it a lot lately. The problem that I've come across a lot is the -> operator. I'm trying to develop web applications using classes and to pass objects to templates instead of variables.
That's why something like this:
<a href=page.php?param={$obj->foo()}>
mess the things up with most HTML editors. Using href="..." can help ... sometimes.
I thing another operator (like ::) would be better.


Last edited by abautu on Wed Oct 08, 2003 5:41 am; edited 1 time in total
Back to top
View user's profile Send private message Yahoo Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Oct 07, 2003 3:23 pm    Post subject: Reply with quote

I don't think the '->' syntax will be chaning anytime soon, but you can use whatever symbol you want and write a prefilter to convert it back to '->' at compile time.
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


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

PostPosted: Tue Oct 07, 2003 10:01 pm    Post subject: Reply with quote

That's a good example. You can also try to register the object so that it has a more regular (template function-like) syntax.
Back to top
View user's profile Send private message
abautu
Smarty n00b


Joined: 07 Oct 2003
Posts: 2

PostPosted: Wed Oct 08, 2003 5:41 am    Post subject: Reply with quote

Thanks about the prefilter advice. I'll try that.
Back to top
View user's profile Send private message Yahoo Messenger
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 -> Feature Requests 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