[TYPO3-50-general] TypoScript syntax: Array indexes

Elmar Hinz elmar07 at googlemail.com
Thu Jul 19 15:49:54 CEST 2007

Robert Lemke wrote:

> Am 19.07.2007 um 12:40 schrieb Elmar Hinz:
>> that's much clearer now. The point is that you want to make a clean
>> decision
>> already during parsing.
>> page.thing = something ???
>> Your question is: Is this treated as an object porperty or is it an
>> array
>> key of an internal object? You don't want to postpone this decision
>> until
>> you know about the internals.
> If we can be absolutely sure that we don't need to know the complete
> semantics
> at parse time, we can keep things like they are of course. So, what
> speaks
> against keeping it? My first thoughts are:

Hi Robert,

it wasn't my intention to discuss if we want complete semantics at parse
time. Certainly we want all feedback that is possible. I just wanted to
understand your question.

But lets do some thoughts. "Complete semantics" means for example, that it
is checked, if an property is allowed within an object and if the value of
that property is valid. Right? 

But where do we get this information from at parsetime for all the objects
and possible userdefined objects?

I don't know how you want to do that, but I guess you want to take this
information directly out of the PHP classes by some kind of introspection.
That would at least avoid the maintainance of similar information in
differnt places. It would be a kind of introspection before the objects are
instanciated at all, maybe by some static methods within those classes. 

However it is done "complete semantics" does probably mean, to "deligate"
parts of the checks to the object classes. At this point we should ask the
question, if it is necessary, that already the tokenizer can detect if a
node (property) is an array or an object. Couldn't this detection be
deligatet the the object classes too? Each class knows all about it's valid
properties, so ambiguity could be completely avoided.

In this case we wouldn't need a special syntax to differ array and objects.
We just could work on with nodes in the traditional way of TS. The syntax
check would become comparingly simple this way. It would check that the
node tree is written correctly, while the rest is "deligated" to the

I stress that I don't think of deligation after instantiation of the
objects, but of deligation by fetching the validation informations out of
the classes before creating them.

Pow, that have been some very complex thoughts. I hope you get the idea,
what I mean.



More information about the TYPO3-project-5_0-general mailing list