[Typo3-dev] OT: Quesstion about PHP syntax in extensions
Christopher
tombedlam at yahoo.com
Thu Jun 17 09:40:47 CEST 2004
Hello-
--- Wolfgang Klinger <wolfgang at stufenlos.net> wrote:
>
> *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) ,-)
Thanks Wolfgang- I had managed (finally!) to figure this out in only
4358098342362436436 attempts at populating a TS form from an extension
;-)
One thing I still wonder - is this some special php syntax (and if so,
what is it, and where is it documented?), or are we just populating an
array with similarly named elements?
-Christopher
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
More information about the TYPO3-dev
mailing list