Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
functions [2018/09/24 12:51]
aducomadmin
functions [2019/03/21 10:19] (current)
aducomadmin
Line 1: Line 1:
 ===== PHsPeed functions (general) ===== ===== PHsPeed functions (general) =====
 +
 +Once you start building applications,​ you will add PHP code to events. Below is a list of pre-set functions you can use
  
 |function|description|prototype|returns|Notes| |function|description|prototype|returns|Notes|
Line 7: Line 9:
 |isLoggedOn|Testst if the current users is logged on|isLoggedOn()|true or false|if(isLoggedOn()) { … }| |isLoggedOn|Testst if the current users is logged on|isLoggedOn()|true or false|if(isLoggedOn()) { … }|
 |phspCrypt|Encrypts and Decrypts data.|phspCrypt($string,​ $mode)|string|available modes are: '​e'​ for encryption and '​d'​ for description. The key and salt used is setup in the project properties. This function is used by PHsPeed to store database credentials,​ emailing options etc. Once set in the IDE then do not change as this will make the encrypted files unreadable. \\   \\ Sample: $mystr=phspCrypt($enc,​ '​e'​);​| |phspCrypt|Encrypts and Decrypts data.|phspCrypt($string,​ $mode)|string|available modes are: '​e'​ for encryption and '​d'​ for description. The key and salt used is setup in the project properties. This function is used by PHsPeed to store database credentials,​ emailing options etc. Once set in the IDE then do not change as this will make the encrypted files unreadable. \\   \\ Sample: $mystr=phspCrypt($enc,​ '​e'​);​|
-|phspRedirect|Redirects current form to another page.|pshpRedirect($url);​|nothing|Sample: ​phspRedirect('​main.php'​);​| +|PHP redirect|Redirects current form to another page.|PHP redirect($url);​|nothing|Sample: ​PHP redirect('​main.php'​);​| 
-|rtrSubmitBtn|Retrieves the id of the button clicked|rtrSubmitBtn();​|string|This function will return the button clicked. It is only to be used in the submit process and is not usable in ajax events. If you have more buttons on the form and want to take action depending on the submitbutton ​clicked then this function is useful. \\ Sample: \\   \\ $key=rtrSubmitBtn();​ \\ if($key=='​mail_btn_1'​) { …. } \\  \\ The name of the button is the name that is used in it'​s ​constructor (#module _ #name). So if the php modules name is '​myapp'​ and the button is called '​mybtn'​ then the function would return '​myapp_mybtn'; ​ |+|rtrSubmitBtn|Retrieves the id of the button clicked|rtrSubmitBtn();​|string|This function will return the button clicked. It is only to be used in the submit process and is not usable in ajax events. If you have more buttons on the form and want to take action depending on the submit button ​clicked then this function is useful. \\ Sample: \\   \\ $key=rtrSubmitBtn();​ \\ if($key=='​mail_btn_1'​) { …. } \\  \\ The name of the button is the name that is used in its constructor (#module _ #name). So if the PHP modules name is '​myapp'​ and the button is called '​mybtn'​ then the function would return '​myapp_mybtn'; ​ |
 |session_stop|Releases session variables and closes current session|session_stop()|nothing|This function will prevent data to be saved in a reusable session cookie after termination of the application.| |session_stop|Releases session variables and closes current session|session_stop()|nothing|This function will prevent data to be saved in a reusable session cookie after termination of the application.|
  
Line 16: Line 18:
  
 |function|description|prototype|returns|Notes| |function|description|prototype|returns|Notes|
-|showMessage|Displays a modal message|showMessage($msg)|nothing| ​ \\ In general this function can be used in submit and in ajax stage to display a popup message, but only on events that passes the $app object. \\  \\ Example: $app→showMessage('​process complete'​);​ \\  \\ See also macro notation (@@showMessage('​...'​); ​\\   |+|showMessage|Displays a modal message|showMessage($msg)|nothing| ​  ​\\ In general this function can be used to submit and in ajax stage to display a popup message, but only on events that passes the $app object. \\   ​\\ Example: $app→showMessage('​process complete'​);​ \\  \\ See also macro notation (@@showMessage('​'​); ​ |
 | | | | | | | | | | | |
  
Line 22: Line 24:
  
 |function|description|prototype|returns|Notes| |function|description|prototype|returns|Notes|
-|@@login(...)|will be translated to $app->login(...)| | |For some common ​used functions it is more convenient to use the @@ notation as PHsPeed will '​know'​ in what module the function resides. So you don't have to remember that login is part of $app.| +|@@login()|will be translated to $applogin()| | |For some commonly ​used functionsit is more convenient to use the @@ notation as PHsPeed will '​know'​ in what module the function resides. So you don't have to remember that login is part of the $app.| 
-|@@showMessage|will be translated to $app>​showMessage(...)| | | |+|@@showMessage|will be translated to $app>​showMessage()| | | |
  
 \\ \\