@@ 35-40 (lines=6) @@ | ||
32 | /** @var ControllerCollection $controller */ |
|
33 | $controller = $app['controllers_factory']; |
|
34 | ||
35 | $controller->get('/{action?}', function (Request $request, $action = null) { |
|
36 | return $this->respond($request, function (BreadCrumbsTrail $crumbs, ParameterReader $reader) use ($action, $request) { |
|
37 | $execution = new ExecutionResource($this->domin, $reader, $crumbs); |
|
38 | return $execution->handleGet($action, $request->get(ExecutionResource::TOKEN_ARG)); |
|
39 | }); |
|
40 | }); |
|
41 | $controller->post('/{action}', function (Request $request, $action) { |
|
42 | return $this->respond($request, function (BreadCrumbsTrail $crumbs, ParameterReader $reader) use ($action, $request) { |
|
43 | $execution = new ExecutionResource($this->domin, $reader, $crumbs); |
|
@@ 41-46 (lines=6) @@ | ||
38 | return $execution->handleGet($action, $request->get(ExecutionResource::TOKEN_ARG)); |
|
39 | }); |
|
40 | }); |
|
41 | $controller->post('/{action}', function (Request $request, $action) { |
|
42 | return $this->respond($request, function (BreadCrumbsTrail $crumbs, ParameterReader $reader) use ($action, $request) { |
|
43 | $execution = new ExecutionResource($this->domin, $reader, $crumbs); |
|
44 | return $execution->handlePost($action, $request->get(ExecutionResource::TOKEN_ARG)); |
|
45 | }); |
|
46 | }); |
|
47 | ||
48 | return $controller; |
|
49 | } |