Components and objects
PHsPeed is a component based development system. You design your forms or modules by adding components to the design panel and modify properties, by setting them in the property editor or modify them by code.
There are three types of components:
- Non visual components
Non visual components are components that encapsulate 'non visual' behavior. For instance access to a database, a timer, anything that has no visual representation.
- Layout components
PHsPeed uses the bootstrap grid system to layout your forms and make them responsive. You will find components as 'panel', 'row' and 'column' in this category.
- Visual components
Visual components are components that have a visual representation. Samples are edit fields, check boxes, grids etc.
Components have properties and events. Some properties are needed to rebuild your IDE, others have a direct influence in the behavior of the component. Examples of components that have no application function are 'top, left, height, and width.' They are only used within the IDE and NOT in the PHP environment. Other properties are static and are, for instance, used to generate classes and styles which are being used to generate CSS files. Some properties are dynamic and being used within the generated PHP code. I.e., the color of the component. Within the IDE these properties are identified by an icon and can be filtered to be shown or not.
Events are being triggered while running your application and allow you to insert code of your own. There are two types Server Events and Client Events.
- Server Events are happening on your server, these are PHP events.
- Client Events are happening on the client, so within your browser. These are Javascript events.
Some events have an occurrence in the Server Event as the JS event. Here Javascript communicates directly with the PHP. These are Ajax events.
Required components
Every PHP basic module needs to have a root component that defines the kind of application it needs to generate. Currently, we have the following types:
Component |
Description |
Root |
This is a standard PHP application that contains a form |
Building block |
This is a reusable module that in general is hosted by a root application |
Blank |
This is a regular PHP application without a form |
Rest service |
Under development, to be used for consuming rest services. Currently to be implemented by using a blank application. |
Generic properties
Property |
Description |
Align |
This property aligns a component on the design panel. This property controls the position and thus the order of creating components. The creation sequence of the components are determined by its top and left position. |
Height |
Height of a visual component on the design form. This does not affect the space used on the generated HTML form as this is to be decided by Bootstrap. Nonvisual components do not have a height property. |
Left |
Left position of the component on the design form |
Name |
Name of the component. This is also the main id as used within the generated applications. In the HTML form this variable will be called 'name=“name”; id=“id-name”. In the PHP code, the bound variable will be $app→moduleid→name. All variables will be generated as lowercase variables. So a MyVariableName will become myvariablename. Use undercast to make your names readable like my_variable_name. |
Owner |
Owner of the component. This property keeps the components together in a tree structure. Is important for generating HTML forms. |
Top |
The upper position of the component on the design form |
Width |
The width of the visual component on the design form. Non-visual components do not have a width property. |
DeviceClassDesktop |
The number of units (1..12) to be used of the parent |
DeviceClassDesktopXL |
The number of units (1..12) to be used of the parent |
DeviceClassDesktopMobile |
The number of units (1..12) to be used of the parent |
DeviceClassDesktopPhone |
The number of units (1..12) to be used of the parent |
DeviceClassDesktopTablet |
The number of units (1..12) to be used of the parent |
Generic server events (PHP Based)
Property |
Description |
Remarks |
OnActivate |
Triggers when the form becomes active |
This event is triggered after all components have been created. So it is safe to reference other components and properties. |
OnCreate |
Triggers when the component is created |
If you write code in this event, then do NOT reference properties of other components as you can never be sure that this component is (already) created. Use OnActivate instead. |
OnDestroy |
Triggers when the component is destroyed |
|