1 | <?php |
||
19 | class SampleJsonController implements ContainerInjectableInterface |
||
20 | { |
||
21 | use ContainerInjectableTrait; |
||
22 | |||
23 | |||
24 | |||
25 | /** |
||
26 | * @var string $db a sample member variable that gets initialised |
||
27 | */ |
||
28 | private $db = "not active"; |
||
29 | |||
30 | |||
31 | |||
32 | /** |
||
33 | * The initialize method is optional and will always be called before the |
||
34 | * target method/action. This is a convienient method where you could |
||
35 | * setup internal properties that are commonly used by several methods. |
||
36 | * |
||
37 | * @return void |
||
38 | */ |
||
39 | public function initialize() : void |
||
44 | |||
45 | |||
46 | |||
47 | /** |
||
48 | * This is the index method action, it handles: |
||
49 | * GET METHOD mountpoint |
||
50 | * GET METHOD mountpoint/ |
||
51 | * GET METHOD mountpoint/index |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | public function indexActionGet() : array |
||
63 | |||
64 | |||
65 | |||
66 | /** |
||
67 | * This sample method dumps the content of $di. |
||
68 | * GET mountpoint/dump-app |
||
69 | * |
||
70 | * @return array |
||
71 | */ |
||
72 | public function dumpDiActionGet() : array |
||
82 | |||
83 | |||
84 | |||
85 | /** |
||
86 | * Try to access a forbidden resource. |
||
87 | * ANY mountpoint/forbidden |
||
88 | * |
||
89 | * @return array |
||
90 | */ |
||
91 | public function forbiddenAction() : array |
||
99 | } |
||
100 |