Samples

Basic component samples

Interested?

Don't forget to subscribe to one of our free webinars!  Show me

Low code platform

PHsPeed is a low-code platform. The next sample application can be created without a single line of code. However, as this is a demo application, we did make some small modifications to give you some insight of the flexibility. 

Sample application

Event examples

PHsPeed uses components that have properties and events. Components are reusable 'bricks' that have a certain function, like connecting to a database, retrieving input of the screen, etc. Properties are used to change the default behavior of a component, i.e. the coloring, type of data, credentials and more. Events are used to change the standard programming behavior of the components. As an example of the power of events we have modified the basic sample to show the behavior of events:

First, we wanted a logon procedure. Sometimes you don't want to make use of the internal functionality, and in this sample we accept any userid / password. To be able to, we bypassed the internal module by setting a property and apply a small piece of code to the 'onLogin' event:

function root_1_onLogin($app, $userid, $password)
{
   return true;
}

Database connection credentials are by default saved on the server in an encrypted file. To maintain that file there is a config application that can be uploaded to the server, to set the server credentials. Another option is to run this application local on your machine and upload the encrypted file. Some developers prefer a less safe method and like to use some kind of config file. In this sample we bypassed the database connection credentials by setting a property and apply some code in the 'onBeforeConnect' event:

function dbconnection_1_onBeforeConnect()
{
   DBConnect($this);
}

DBConnect is a procedure that is required in all modules that uses database tables. Therefore we implemented the following procedure as a 'project library'. 

<?php

function DBConnect($db)  {
   $db->userid='my userid';
   $db->password='my password';
   $db->database='my database';
   $db->server='localhost';
   $db->port='3306';
}

?>

The samples are based upon the open-source Employee MySQL database. This database contains around 350.000 'persons', and around 3.500.000 salary records. Therefore this sample is a good example regarding performance. Because the sample uses database grids that can be quite large, this sample application is designed for tablet and desktop, not mobile phones. The screens are too small to show wide database grids. But as PHsPeed is bootstrap based, it is very well suited for applications that needs to run on mobiles.  

Sample application