Created
November 27, 2017 15:48
-
-
Save karlhinze/9645255ead5ad81bdfc33e91ca3f3b32 to your computer and use it in GitHub Desktop.
Example LiveWhale module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Save this file in /livewhale/client/modules/mymodule/ and login to LiveWhale to load the module for the first time. | |
$_LW->REGISTERED_APPS['my_module']=array( | |
'title'=>'My Module', | |
'handlers'=>array('onFormsSubmission'), | |
); | |
class LiveWhaleApplicationMyModule { | |
public function onFormsSubmission($id) { | |
global $_LW; | |
if ($id == 123) { // Replace this with the ID number for your LiveWhale form | |
// Pull values from fields, checking the form's HTML to get the field names | |
$field1 = strip_tags($_LW->_POST['lw_form_123_1234567890']); | |
$field2 = strip_tags($_LW->_POST['lw_form_123_1234567891']); | |
// etc. | |
// Put the rest of your script here, including any create() or update() actions based on your form. | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment