[Typo3-dev] OT: Quesstion about PHP syntax in extensions

Wolfgang Klinger wolfgang at stufenlos.net
Thu Jun 17 09:17:33 CEST 2004


 *hiya!*

 On Wed, 16 Jun 2004, Christopher wrote the following:
> That's what I was doing when I noticed this. So does this just mean
> that 'property1.' is simply the name of the element in the array? (And
> here I thought it was doing something tricky...)

 It's tricky ;-)

 e.g.
----------------
myext_pi1.myprop = on
myext_pi1.myprop.value1 = i'm the first one
myext_pi1.myprop.value2 = i'm the second one
----------------

 So you can now test (first) if myprop should get any attention by
----------------
if (isset($conf['myprop']) && 
    $conf['myprop'] == 'on' && 
    count($conf['myprop.'])) {  // dot!

    // ....... do something
}
----------------
 (or check anything else - whatever)
 and then fetch the values with
----------------
$val1 = $conf['myproperty.']['value1'];  // dot!
----------------

 So the dot is very important, without it it's not possible to distinguish 
 between the actual value and sub elements.
 (it's not always useful but nice to have) ,-)

 bye
 Wolfgang







More information about the TYPO3-dev mailing list