[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Praise and a question



On Fri, Aug 04, 2000 at 05:11:53PM -0600, Joey Smith wrote:
> I just want to start by saying what a boon WML has become in my
> projects. Being able to use makefiles and such to keep a layer of
> abstraction between code and presentation is wonderful...
> 
> I do, however, seem to have run up against a small snag. I use PHP, and
> I cannot seem to get the following consrtuct to work in WML 2.0.1. I'm
> wondering if it is me, the language, or what...
> 
> I want to do something like:
> $(some_var:-"$php_var")
> 
> ie, if some_var is not set from WML, I want it to default to a string
> containing a $, but this just seems to hang WML indefinitely...I'm
> resonably sure it's trying to resolve the php_var part.

Indeed, there seems to be a problem with dollars in such constructs.

> Is there any way to do this? It does not seem to be honoring the
> backslash escape...

I do not remember exactly what happens with this feature, i may have
removed it because it has many drawbacks.

> I also tried using pass 3, but I couldn't seem to figure out the proper
> usage there either (at least ePerl would bomb on me...ipp just hangs).

<:
   $some_var = '$php_var' if ($some_var eq '');
:>

> So, am I nuts? Is there just not any way to do this? Or am I just
> missing something obvious? (20 hour days'll do that to a guy...)

Well, there is indeed a bug in pass 1.  But there are many workarounds.
For instance, you may define
  <define-tag _dollar_>$</define-tag>
in your templates, and write
  $(some_var:-"<_dollar_>php_var")

Awful, but it works.

-- 
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com