original_string: public function htmlAction(Request $request, $teaserId)
      {
          $requestStack = $this->get('request_stack');
          $masterRequest = $requestStack->getMasterRequest();
  
          if ($request->get('preview') || $request->get('_preview')) {
              $request->attributes->set('_preview', true);
          } elseif ($masterRequest !== $request && $masterRequest->attributes->get('_preview')) {
              $request->attributes->set('_preview', true);
          }
  
          $teaser = $this->get('phlexible_teaser.teaser_service')->find($teaserId);
  
          $request->attributes->set('contentDocument', $teaser);
  
          $renderConfigurator = $this->get('phlexible_element_renderer.configurator');
          $renderConfig = $renderConfigurator->configure($request);
  
          if ($renderConfig->getResponse()) {
              return $renderConfig->getResponse();
          }
  
          if ($request->get('template')) {
              $renderConfig->set('template', $request->get('template', 'teaser'));
          }
  
          $data = $renderConfig->getVariables();
  
          return $this->render($data['template'], (array) $data);
      }
code: public function htmlAction(Request $request, $teaserId)
      {
          $requestStack = $this->get('request_stack');
          $masterRequest = $requestStack->getMasterRequest();
  
          if ($request->get('preview') || $request->get('_preview')) {
              $request->attributes->set('_preview', true);
          } elseif ($masterRequest !== $request && $masterRequest->attributes->get('_preview')) {
              $request->attributes->set('_preview', true);
          }
  
          $teaser = $this->get('phlexible_teaser.teaser_service')->find($teaserId);
  
          $request->attributes->set('contentDocument', $teaser);
  
          $renderConfigurator = $this->get('phlexible_element_renderer.configurator');
          $renderConfig = $renderConfigurator->configure($request);
  
          if ($renderConfig->getResponse()) {
              return $renderConfig->getResponse();
          }
  
          if ($request->get('template')) {
              $renderConfig->set('template', $request->get('template', 'teaser'));
          }
  
          $data = $renderConfig->getVariables();
  
          return $this->render($data['template'], (array) $data);
      }
code_tokens: public function htmlAction ( Request $ request , $ teaserId ) { $ requestStack = $ this -> get ( 'request_stack' ) ; $ masterRequest = $ requestStack -> getMasterRequest ( ) ; if ( $ request -> get ( 'preview' ) || $ request -> get ( '_preview' ) ) { $ request -> attributes -> set ( '_preview' , true ) ; } elseif ( $ masterRequest !== $ request && $ masterRequest -> attributes -> get ( '_preview' ) ) { $ request -> attributes -> set ( '_preview' , true ) ; } $ teaser = $ this -> get ( 'phlexible_teaser.teaser_service' ) -> find ( $ teaserId ) ; $ request -> attributes -> set ( 'contentDocument' , $ teaser ) ; $ renderConfigurator = $ this -> get ( 'phlexible_element_renderer.configurator' ) ; $ renderConfig = $ renderConfigurator -> configure ( $ request ) ; if ( $ renderConfig -> getResponse ( ) ) { return $ renderConfig -> getResponse ( ) ; } if ( $ request -> get ( 'template' ) ) { $ renderConfig -> set ( 'template' , $ request -> get ( 'template' , 'teaser' ) ) ; } $ data = $ renderConfig -> getVariables ( ) ; return $ this -> render ( $ data [ 'template' ] , ( array ) $ data ) ; }
docstring: Render action.
  
  @param Request $request
  @param int     $teaserId
  
  @return Response
  @Route("/{_locale}/{teaserId}", name="teaser_render")
docstring_tokens: Render action .