Re: nameless params?

From: Date: Tue, 20 Nov 2001 15:31:14 +0000
Subject: Re: nameless params?
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1990@lists.php.net to get a copy of this message
On Tue, 20 Nov 2001, Ivo Jansch wrote: > Hello, > > since I caused quite some dust with my question about alternative > looping, I might as well add another question I was wondering about. :) > > If a tag has just one parameter, is it possible to leave out the name of > the parameter? > > For example, if I create a custom function like this: > > {img src="picture.jpg"} > > would it be possible to do this: > > {img picture.jpg} ? > > Ok, flame me for completely abusing the templatelanguage, but if I still > want to do it, would it be possible? If you write a custom function, the first parameter to it will be the complete string from the name of the tag to the closing delimiter, so you can do whatever you want with it. You don't have to call _parse_attrs() necessarily. -Andrei What's hard, in hacking as in fiction, is not the writing, it's deciding what to write. -- Neal Stephenson

« previous php.smarty.general (#1990) next »