[Typo3-dev] Syntax / Error highlighting TypoScript
Martin T. Kutschker
Martin.T.Kutschker at blackbox.net
Fri Apr 9 09:53:00 CEST 2004
Georg Rehfeld wrote:
>
> My suggestion boiles down to checking ALL Typoscript objects/properties
> against the PHP classes that are expected to do some work with these
> properties at _compiletime_ instead of simply failing without notice
> at _runtime_ .
There is no static info available. The syntax is IMHO to vague to even
allow such a thing. And anyway, the Core and the extensions evaluate
properties (and objects) as they see fit.
> As far as I can see currently this feature would require major changes
> in all and every Typo3 PHP class:
See above.
> - every class had to _register_ it's allowed properties somewhere.
Like a DTD or XML schema? The problem here is the "every class". While
the basic TS objects are reflected by a single class (tslib_content) it
gets messy with the extension classes (USER and USER_INT objects). One
could assume that if the prcessing function is something like
CLASS->main or at least CLASS->something, then this CLASS is the one we
need (and need to include_once, an info that's usually in the TS itself
as a property!).
> - every class had to have a _ListProperties()_ method, giving back
> all registered (usable) properties, probably accompanied by the
> datatype requiered, implemented to enumerate the properties
> of sub-objects by delegation.
Uh oh, we have copies and refs in TS. And basically you can invent
properties of no type at all:
xxx.foo
xxx.bar
xxx is nothing, it's internally just a PHP array.
> - every class had to _ignore_ any property not registered to
> avoid 'secrets'
This is a recommendation, right?
> - the Template Analyzer had to call the ListProperties() method on
> every top level object and compare to the TS given, highlighting
> unknown properties/objects.
Follows your earlier ideas.
> Still I think this would be a big step towards usability of Typo3
> (at least for newbies, but saving time for experts too).
Sure. Every tiny bit of help speeds up development.
> What do you think?
Interesting, but I'm not sure it can be done. I think it may be possible
for standard cases, but there is legacy code and TS is quite flexible.
Masi
More information about the TYPO3-dev
mailing list