Re: [SMARTY-DEV] Problems with modifiers and objects
| From: | Monte Ohrt | Date: | Wed, 12 Feb 2003 20:57:25 +0000 |
| Subject: | Re: [SMARTY-DEV] Problems with modifiers and objects | ||
| References: | 1 2 3 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-681@lists.php.net to get a copy of this message | ||
Yes the first one makes better sense to me too.
Monte
On Wed, 2003-02-12 at 14:55, M Mohr wrote:
> 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
--
Monte Ohrt <monte@ispi.net>