Re: [SMARTY-DEV] Problems with modifiers and objects
| From: | M Mohr | Date: | Wed, 12 Feb 2003 20:55:57 +0000 |
| Subject: | Re: [SMARTY-DEV] Problems with modifiers and objects | ||
| References: | 1 2 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-680@lists.php.net to get a copy of this message | ||
On Wed, Feb 12, 2003 at 11:51:00AM -0600, Monte Ohrt wrote:
> Actually this could be supported if we don't allow modifiers on object
> parameters. Does anyone see a practical reason to support it?
>
> If we don't allow the modifiers, then we can support what you're asking.
>
> So we make a choice, either support objects as parameters to modifiers:
>
> {$foo|bar:$foo->bar}
>
> or support modifiers on object parameters:
>
> {$foo->bar($foo|bar,$foobar|foo|bar)}
>
> We can't have both, because regex does not work with recursion.
i would vote for the first one: objects (or objects' properties) as
parameters to modifiers.
i really don't know why i like it more. maybe the second one does not
seem that consistent to me: modifiers, AFAIR, modified always output
in smarty, here they would modifiy input. right?
> On Tue, 2003-02-11 at 17:50, David Heinemeier Hansson wrote:
> > This construct:
> >
> > {$form->lastModified->toString()|default:$form->created->toString()}
> >
> > Produces this error:
> >
> > Fatal error: Smarty: [in form/showForm.html line 22]: syntax error:
> > unrecognized tag:
> > $form->lastModified->toString()|default:$form->created->toString()
> > (Smarty_Compiler.class.php, line 381) in
> > /Smarty-2.4.2/Smarty_Compiler.class.php on line 1857
> >
> > Where's this is fine:
> >
> > {$form->lastModified->toString()|default:"works!"}
> >
> > Clues?
> > --
> > David
> --
> Monte Ohrt <monte@ispi.net>
>
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
Copyright: 9. Full ISOC Copyright Statement Copyright (C) The Internet Society
(1998). All Rights Reserved. This document and translations of it may be
copied and furnished to others, and derivative works that comment on or
otherwise explain it or assist in its implmentation may be prepared, copied,
published and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are included
on all such copies and derivative works. [...] 10. Full ITU Copyright
Statement Copyright (C) ITU (1998). All Rights Reserved. No part of this
publication may be reproduced or utilized in any form or by any means,
electronic or mechanical, including photocopying and microfilm, without
permission in writing from the ITU.
Collaboration between ISOC/IETF and ITU-T
<tt><draft-itu-isoc-00.txt></tt>