Completed
Push — master ( f8decb...0d0ae6 )
by Arnaud
15s
created

Debug::test()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 0
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Controllers\Ajax;
4
5
//to call, require /ajax/debug/'action'
6
use Core\AjaxController;
7
8
class Debug extends AjaxController
9
{
10
    public function test()
11
    {
12
        $referer = $this->request->getReferer();
13
        $host = $this->request->getBaseUrl();
14
15
        $jsonData = [
16
            "Referer" => $referer,
17
            "https" => $host,
18
            "Message" => 'Ok message sent'
19
        ];
20
        $result = $this->jsonResponse($jsonData);
21
        echo $result;
22
23
24
    }
25
}