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

Dreamweaver (dwmx) rewriting code on the fly... !@#!@##!@

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
getafix
Smarty n00b


Joined: 12 Feb 2004
Posts: 2

PostPosted: Thu Feb 12, 2004 5:53 am    Post subject: Dreamweaver (dwmx) rewriting code on the fly... !@#!@##!@ Reply with quote

First of all greetings to all (1st time poster, long time lurker). Congrats to the Smarty team and contributors for a killer product.

Now the questions.. Having recently moved to dwmx, I've noticed that DWMX keeps rewriting my object variable refs, so for example


{$someobject->somevar}

Is getting translated on-the-fly to:

{$someobject-&somevar}


Actually there's a g-t-semicolon after the ampersand but I can't get it to show up properly in this form view. Anyway, this obviously borks the page render.

I've turned off ALL code-re-writing options under the site manager, but it still seems to happen when I edit files with the .TPL extension. I've also added this extension to the recognized page types, but to no avail. Sometimes it will re-write.. I'll change it back.. and then after a page-save it reverts.. arghh...

Anyway, I know this is a DWMX related question, but I was wondering if any smarty designers may have any suggestions.

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


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

PostPosted: Thu Feb 12, 2004 9:50 am    Post subject: Reply with quote

AFAIR Monte suggested, that one can use prefilter to replace all "::" with "->". This should be an easy task.

Then the designer can use {$foo::bar} instead of {$foo->bar}. The prefilter replaces the "::" just before the code is handed out to the compiler. so this is only done at compilation and has no overhead at display.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
getafix
Smarty n00b


Joined: 12 Feb 2004
Posts: 2

PostPosted: Fri Feb 13, 2004 4:14 am    Post subject: Reply with quote

Ahh this is an interesting approach. I will give that a try, thank you. I did several searches here for Dreamweaver Code rewrite but didn't find that one.

cheers!
Back to top
View user's profile Send private message
desr333
Smarty Rookie


Joined: 17 Apr 2003
Posts: 10
Location: California

PostPosted: Thu Feb 19, 2004 9:32 pm    Post subject: Reply with quote

If you enter:

{$someobject->somevar}


in dwmx "design view" it will change the actual html code to:
{$someobject-&somevar} (with the "gt;" after the &.)

The trick is to use "code view" at this point. I like to use the split view so I can see exactly what dwmx is doing to the code when I'm designing.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty Development 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