コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function renderResponse($data = null)
 {
     $request = $this->getRequest();
     $template = $this->buildTemplate($request);
     if (false === $this->isMasterRequest($request) || true === $request->isXmlHttpRequest()) {
         $other = $this->buildTemplate($request, '_');
         if ($this->renderer->templateExists($other)) {
             $template = $other;
         }
     }
     return $this->renderer->renderResponse(['template' => $template, 'parameters' => $data]);
 }
コード例 #2
0
 function it_supports_format_of_his_sub_renderer(TwigRenderer $renderer, $result)
 {
     $renderer->supportsContentType('test')->willReturn($result)->shouldBeCalledTimes(1);
     $this->supportsContentType('test')->shouldReturn($result);
 }