Date: 12/21/00
- Next message: Bob Bowker: "Re: [phplib] input in flex scanner failed"
- Previous message: Max A. Derkachev: "Re: [phplib] PHP 4.0.4 problem with templates"
- In reply to: Max A. Derkachev: "Re: [phplib] PHP 4.0.4 problem with templates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Yes, that is a possibility, but my example code was of course
simplified. In reality I call a function that formats
currency and does nice things like put a "-" in front if the
value is negative. Also, I have cases where the amount is blank
- in which case I don't want the "$" to display.
Thanks for the idea. I'm hoping to get a response from the PHP
team to my bug report. I figure there has to be a way to do
this in PHP 4.0.4. Additionally, I think we are going to need
to modify the PHPLIB template class to escape "$" in the value
array. I'll wait for a resolution to my bug before I go any
further on that path.
Padraic
* Max A. Derkachev <kot <email protected>> [Dec 21 11:37am]:
> Hello Padraic,
>
> What if you change {FOO} to ${FOO} in your template,
> and then $tpl->set_var ('FOO', '7.50') ?
> And if you use different currencies, prepend {cur} to {FOO}.
> Then $tpl->set_var(array ('cur' => '$',
> 'FOO' => '7.50');
>
> Wednesday, December 20, 2000, 8:08:21 PM, you wrote:
>
> PR> Any one else tried PHP 4.0.4 with the PHPLIB template class?
>
> PR> I'm having a new problem which I think is due to the new
> PR> back reference handling in 4.0.4.
>
> PR> Specifically code like:
> PR> print(preg_replace("/{FOO}/","\$7.50","Amount is {FOO}"));
> PR> Results in:
> PR> Amount is .50
>
> PR> When under prior versions it resulted in:
> PR> Amount is $7.50
>
> PR> I tried escaping the "$" with "\$" but that didn't work.
>
> PR> My PHP bug report is at:
> PR> http://bugs.php.net/?id=8339
>
> PR> Thoughts?
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Bob Bowker: "Re: [phplib] input in flex scanner failed"
- Previous message: Max A. Derkachev: "Re: [phplib] PHP 4.0.4 problem with templates"
- In reply to: Max A. Derkachev: "Re: [phplib] PHP 4.0.4 problem with templates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

