[TYPO3-50-general] Beer3 - Array Syntax and View Helpers
Bastian Waidelich
bastian at typo3.org
Wed Oct 29 11:16:17 CET 2008
Sebastian Kurfürst wrote:
Hi Sebastian,
first: thanks for your great work so far, I'm excited about the speed
that this idea is getting concrete!
> First of all, I implemented array access syntax in Beer3
Great stuff and I think, it's a good alternative to the
parameters.parameter1-syntax!
> So, we only allow associative arrays at this place.
Well, no beer is perfect ;)
> It would be really great if you read over these things and tell me if
> something is missing
nice collection!
some suggestions regarding the naming:
I prefer <f3:loop over="..." as="..."> over the for each syntax, as this
reminds me too much of the PHP foreach, though it might be different
(see below). But I guess, both is ok!
Regarding links and URIs (we decided to stick with "URI" instead of
"URL" in FLOW3 context):
I wouldn't use the word "link" as top-level element. Actually it's more
a "URI-helper" and link is one "sub-helper" (that's how it's handled in
RoR too:
http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html).
So maybe it could be:
<f3:uri.linkTo action="...
and
<f3:uri.uriFor action="...
or
<f3:uri.tag action="...
and
<f3:uri action="...
Similar thing with the image:
<f3:image.tag maxWidth="...
and
<f3:image.uri maxWidth="...
if you only want to use the URI of the generated image..
Don't know.. I'm not perfectly happy with this either, but I think it's
already a bit more consistent.
A few more helpers I can think of at the moment (some of them probably
shouldn't be part of the core though):
- Form (input, select, submit, ....) - That's probably provided by some
form engine..
- Email (that's probably part of the URI helper)
- L10N... black hole ;)
- General formatters (raw, integer, float, rich text) - by default
{post.title} should be htmlspecialchar'ed of course.
- Grid <f3:grid headers="{col1:'POST ID', col2:'POST TITLE'}"
columns="{col1:'id', col2:'title'}" for="{posts}" /> ...something like
that - Or at least some general table helper.
And I think, there could be some more (optional) view helper parameters
like:
<f3:loop over="{posts}" as="post" key="index" counter="i"...
And all tag based helpers (image, link, ...) should allow all/most of
the existing (X)HTML attributes like:
<f3:image width="..." maxWidth="..." title="..." rel="..." ...
Even though that would bloat the view helpers quite a bit (another
reason why we should use view helper classes rather then methods to be
able to extend some abstract "tagbased" view helper).
> is there anybody here who would like to help programming the templatingengine with me?
I'll be quite busy with the Routing until the first release. But I'll
happily help wherever I can!
Bastian
More information about the TYPO3-project-5_0-general
mailing list