So, if you design a form, then all form components are actually objects in PHsPeed. If you generate code you can easily find this in the main module. PHsPeed will always create a variable $app and that variable is passed in almost every event that you can use. This $app variable instantiates a class inherited from spapplication, and the constructor will create all the form objects (simplified):

 

class comment extends spapplication {

  protected $comment_root_1;

  protected $comment_dbconnection_1;

  protected $comment_dbtable_1;

  protected $comment_datasource_1;

  protected $comment_form_1;

  protected $comment_gridpanel_1;

  protected $comment_dbgrid_1;


  public function __construct($config, $connectionstrings) {

    global $connections;

    global $apikeys;

    $this->sessionmethod='P';

    $this->comment_form_1 = new comment_form_1($this, $currentform);

    $this->registerComponent($this->comment_form_1);

    $currentform=$this->comment_form_1;

    $this->registerForm($this->comment_form_1);

    $this->comment_csrftoken = new comment_csrftoken($this, $currentform);

    $this->registerComponent($this->comment_csrftoken);

    $this->comment_root_1 = new comment_root_1($this, $currentform);

    $this->registerComponent($this->comment_root_1);

    $this->registerRoot($this->comment_root_1);

    $this->bodyclass=$this->comment_root_1->bodyclass;

    $this->comment_dbconnection_1 = new comment_dbconnection_1($this, $currentform);

    $this->registerComponent($this->comment_dbconnection_1);

    $this->comment_dbtable_1 = new comment_dbtable_1($this, $currentform);

    $this->registerComponent($this->comment_dbtable_1);

    $this->comment_datasource_1 = new comment_datasource_1($this, $currentform);

    $this->registerComponent($this->comment_datasource_1);

    $this->comment_gridpanel_1 = new comment_gridpanel_1($this, $currentform);

    $this->registerComponent($this->comment_gridpanel_1);

    $this->comment_dbgrid_1 = new comment_dbgrid_1($this, $currentform);

    $this->registerComponent($this->comment_dbgrid_1);

  }

 }        


 $app = new comment($config, $connectionstrings);   


The $app allows you to access all the properties of all the (other) components. Now let us zoom in into one of the objects:     $this->comment_dbgrid_1 = new comment_dbgrid_1($this, $currentform);

In the IDE this is very easy as you can 'zoom in' into any object. First we need to locate the object. In the project tree you need to locate the object in the generated code:



If you click on the component then the editor will show the generated code. As you can see here, the  comment_dbgrid_1 is extended from spdbgrid. In the sidebar you will find a refrence to all parents (here only one).



Now you click on this line to zoom into the underlying object, until you come to the end, which is .... spobjject.

Following the code is very handy while debugging. If you step through your code, PHsPeed will automatically enter the object code so you can always debug into depth.


More about $this->comment_dbgrid_1. On the designed form you have put a dbgrid. It's name was dbgrid_1. The code generated appended the module name to it. Suppose you rename the module, or you rename the component. After all, dbgrid_1 is not a useful name, you might want to give it a more logical name. I fyou have written event code, then you have to search and replace the names of all the changed properties. To avoid this and to make coding more easier, you can use the $$ notation. We call it 'the magic of $$'.