It's not clear to me when or when not to use $$ for variables. For php standard variables I know that you have to use $.But why $$?
The $$ notation is mainly used to access a component by name, without specifying the full object tree. Suppose you have a form containing a field edit_1. The generated name might be something like myapp->edit_1 The generator will translate the $$ notation into the correct object specifier. More information can be found on our wiki: https://www.phspeed.com/docs/doku.php?id=magicapp