[TYPO3-dev] TCA in loop doesn't work
Christoph Koehler
christoph.koehler at gmail.com
Mon Jan 2 06:12:53 CET 2006
Hello all,
I am trying to get the type of a database field from the TCA array, so I
include the TCA into the frontend and loop through an array of fields to
get their type, like so:
for ($index = 0; $index < sizeof($fields); $index++) {
$type =
$GLOBALS['TCA']['fe_users']['columns'][$fields[$index]]['config']['type'];
}
Now if I debug that and take al ook at type, it shows the right type when
$index = 0, but every single time afterwards, $type becomes null. I have
no idea why.
Here is the rest of my function:
function makeForm($fields = null) {
$content = null;
$fields = explode(',', $fields);
$GLOBALS['TSFE'] -> includeTCA(1);
$temp = $GLOBALS['TCA'];
for ($index = 0; $index < sizeof($fields); $index++) {
$type = null;
$type =
$GLOBALS['TCA']['fe_users']['columns'][$fields[$index]]['config']['type'];
[snip]
}
return $content;
}
Thanks!
Christoph
More information about the TYPO3-dev
mailing list