| @@ 44-54 (lines=11) @@ | ||
| 41 | return $response->getContent(); |
|
| 42 | } |
|
| 43 | ||
| 44 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
| 45 | if ($initialControllerInstance->has('templating')) { |
|
| 46 | return $initialControllerInstance->get('templating')->render($viewName, $params); |
|
| 47 | } |
|
| 48 | ||
| 49 | if (!$initialControllerInstance->has('twig')) { |
|
| 50 | throw new \LogicException('You can not use the "renderView" method if the Templating Component or the Twig Bundle are not available.'); |
|
| 51 | } |
|
| 52 | ||
| 53 | return $initialControllerInstance->get('twig')->render($viewName, $params); |
|
| 54 | } |
|
| 55 | ||
| 56 | public function fromDispatcher($dispatcher){ |
|
| 57 | return \explode("/", Router::getRequest(true)->url); |
|
| @@ 50-60 (lines=11) @@ | ||
| 47 | return $response->getContent(); |
|
| 48 | } |
|
| 49 | ||
| 50 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
| 51 | if ($initialControllerInstance->has('templating')) { |
|
| 52 | return $initialControllerInstance->get('templating')->render($viewName, $params); |
|
| 53 | } |
|
| 54 | ||
| 55 | if (!$initialControllerInstance->has('twig')) { |
|
| 56 | throw new \LogicException('You can not use the "renderView" method if the Templating Component or the Twig Bundle are not available.'); |
|
| 57 | } |
|
| 58 | ||
| 59 | return $initialControllerInstance->get('twig')->render($viewName, $params); |
|
| 60 | } |
|
| 61 | ||
| 62 | public function fromDispatcher($dispatcher){ |
|
| 63 | $request = $dispatcher->get('request_stack')->getCurrentRequest(); |
|