[Typo3-dev] how to create an individual search-form in an extension
Karsten Dambekalns
karsten at typo3.org
Fri Oct 28 18:33:52 CEST 2005
Hi.
First of all: I'll write a new set of extensions shortly, and will be trying
smarty inside TYPO3 then. I used Smarty in the past and I *love* it.
Michael Stucki wrote:
> Your example shows exactly what automaketemplate is being used for!
> I don't see anything new here.
>
> automaketemplate is even better because you don't need to set markers but
> write example content instead!
No, this is useful for page templates, but the original poster was talking
about extensions.
Now, I have a set of variables to show, say in $user, which is an array. I
have a lot of fields, and I have a lot of labels to go along with those
fields. Now I can write a template that looks like this:
----
...
###label_field1### ###value_field1###
###label_field2### ###value_field2###
###label_field3### ###value_field3###
...
----
and use a lot of marker replacements in my PHP code. Or I create a smarty
template and have something like this:
----
...
{$lang.field1} {$user.field1}
{$lang.field2} {$user.field2}
{$lang.field3} {$user.field3}
...
----
Looks pretty similar, but I need only two lines with $smarty->assign() to
assign whole arrays (data and localization). Now, repeating those for a
list view? assign the array, have the loop in the template. Or streamline
the l10n by adding a Smarty function.
There may be different views on all this, but the marker way has been
driving me nuts in the past. Smarty is much nicer, but even this may not be
the end to it all, PHPTAL looks good, too.
Finally: use the right tool. For whatever.
Karsten
More information about the TYPO3-dev
mailing list