[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[TYPO3-dev] TCA in loop doesn't work


  • From: christoph.koehler at gmail.com (Christoph Koehler)
  • Date: Sun, 01 Jan 2006 23:12:53 -0600

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