| @@ 34-42 (lines=9) @@ | ||
| 31 | * @param array $params |
|
| 32 | * @see \Ajax\JsUtils::forward() |
|
| 33 | */ |
|
| 34 | public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){ |
|
| 35 | $path=$params; |
|
| 36 | $request = $initialControllerInstance->get('request_stack')->getCurrentRequest(); |
|
| 37 | $path['_forwarded'] = $request->attributes; |
|
| 38 | $path['_controller'] = $controllerName.":".$actionName; |
|
| 39 | $subRequest = $request->duplicate([], null, $path); |
|
| 40 | $response= $initialControllerInstance->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); |
|
| 41 | return $response->getContent(); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
| 45 | if ($initialControllerInstance->has('templating')) { |
|
| @@ 40-48 (lines=9) @@ | ||
| 37 | * @param array $params |
|
| 38 | * @see \Ajax\JsUtils::forward() |
|
| 39 | */ |
|
| 40 | public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){ |
|
| 41 | $path=$params; |
|
| 42 | $request = $initialControllerInstance->get('request_stack')->getCurrentRequest(); |
|
| 43 | $path['_forwarded'] = $request->attributes; |
|
| 44 | $path['_controller'] = $controllerName.":".$actionName; |
|
| 45 | $subRequest = $request->duplicate([], null, $path); |
|
| 46 | $response= $initialControllerInstance->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); |
|
| 47 | return $response->getContent(); |
|
| 48 | } |
|
| 49 | ||
| 50 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
| 51 | if ($initialControllerInstance->has('templating')) { |
|