-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDataPlumber.php
43 lines (37 loc) · 979 Bytes
/
DataPlumber.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace Craft;
use Craft;
use yii\base\Event;
/**
* Custom module class.
*
* This class will be available throughout the system via:
* `Craft::$app->getModule('my-module')`.
*
* You can change its module ID ("my-module") to something else from
* config/app.php.
*
* If you want the module to get loaded on every request, uncomment this line
* in config/app.php:
*
* 'bootstrap' => ['my-module']
*
* Learn more about Yii module development in Yii's documentation:
* http://www.yiiframework.com/doc-2.0/guide-structure-modules.html
*/
class DataPlumber extends \yii\base\Module
{
public function init()
{
parent::init();
// Submissions
craft()->on(
"freeform_submissions.onAfterSave",
function (Event $event) {
$submission = $event->params["model"];
$isNew = $event->params["isNew"];
error_log($submission);
}
);
}
}