To understand the application structure better, there are some principles that needs explanation. 


When you design a form with web elements, like edit fields, check boxes etc, PHsPeed will generate an object class for each component you put on the form. This class will be derived from it's parent class. If you have added a label component in a form that is part of an application called 'cust_detail' 


then PHsPeed will generate 


To be able to access the components, PHsPeed will generate a main application that instantiates the classes into a single class which is derived from spapplication. 


 class cust_detail extends spapplication {

  public   $action;

  protected $cust_detail_root_1;

  protected $cust_detail_dbconnection_1;

  protected $cust_detail_q;

  protected $cust_detail_form_1;

  protected $cust_detail_panel_1;

  protected $cust_detail_label_1;

  protected $cust_detail_label_2;

  protected $cust_detail_csrftoken;   


The spapplication object  will create all components. 


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

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

    $currentform=$this->cust_detail_form_1;

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

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

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

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

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

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

    $this->bodyclass=$this->cust_detail_root_1->bodyclass;

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

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

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

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

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

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

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

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

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

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

       

Next, the main application will create this class and assign it to the master variable $app. This variable is passed to most events and can be used to access the properties of the other components. The regular way to do that is by adding this code to the events. Every component has them. To see how this works, go to the section 'working with events'.