|
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 |
abautu Smarty n00b
Joined: 07 Oct 2003 Posts: 2
|
Posted: Tue Oct 07, 2003 2:15 pm Post subject: The Smarty '->' operator |
|
|
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 |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Oct 07, 2003 3:23 pm Post subject: |
|
|
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 |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Oct 07, 2003 10:01 pm Post subject: |
|
|
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 |
|
abautu Smarty n00b
Joined: 07 Oct 2003 Posts: 2
|
Posted: Wed Oct 08, 2003 5:41 am Post subject: |
|
|
Thanks about the prefilter advice. I'll try that. |
|
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
|