[TYPO3-german] Naming von Klassen, UserFunction

Dominik Stankowski typo3 at stankowski.ch
Fri Mar 31 11:40:51 CEST 2006


Hallo zusammen

Es gibt da etwas, aus dem ich nicht schlau werde:

Ich programmiere eine Extension für Typo3, welche tt_news erweitert. Für ein
Feld brauche ich ein spezielles Formular-Element, das ich über eine
User-Funktion steuern möchte. Ich habe meine Klasse mit "user_..." benannt,
worauf ich eine spezielle Funktion für ein Formular-Feld programmieren
konnte.

Hingegen sind dann Fehler im Extension Manager aufgetaucht (rote Anzeige:
Naming errors). Ich hab dann die Klasse in "ux_..." umbenannt, was die
Fehler zum Verschwinden gebracht hat.

Nun funktionierte aber meine erweitertes Formular wiederum nicht mehr. In
der Beschreibung steht dort nämlich: 
http://typo3.org/documentation/document-library/core-documentation/doc_core_
api/current/view/4/2/ 
[...] 
If you want to call a function, just enter the function name. The function
name must be prefixed "user_" or "tx_".
If you want to call a method in a class, enter "[classname]->[methodname]".
The class name must be prefixed "user_" or "tx_". 
[...]

Dies erklärt immerhin, beide Fehler, die sich gegenseitig leider nicht
ausschliessen lassen, nicht einmal, wenn man die Klasse mit dem Prefix
"tx_..." gebraucht. Ich habe deswegen noch etwas recherchiert und folgendes
Dokument gefunden: 
http://scriptme.de/typo3conf/ext/nf_downloads/pi1/passdownload.php?downloadd
ata=17&PHPSESSID=937738321b2aa1f000ed5440e9e24a28 
Page 9: 
"Indicates a function or method in a class to call. See
more information at the USER cObject.
Depending on implementation the class or function
name (but not the method name) should probably be
prefixed with “user_”. This can be changed in the
TYPO3_CONF_VARS config though. Also the function
/ method is normally called with 2 parameters, typ. $conf
(TS config) and $content (some content to be
processed and returned)
Also if you call a method in a class, it is checked (when
using the USER/USER_INT objects) whether a class
with the same name, but prefixed with “ux_” is present
and if so, this class is instantiated instead. See “Inside
Typo3” document for more information on extending the
classes in Typo3!"

Nun, somit sollte man also diese Einstellung mit "user_" ändern können.
Leider finde ich diesbezüglich im Dokument "Inside Typo3" nichts darüber...

Hat vielleicht jemand eine Idee?

Gruss,
Dominik




More information about the TYPO3-german mailing list